

--
-- Table structure for table `ug_relatedtopic`
--

CREATE TABLE `ug_relatedtopic` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `ugID` int(11) NOT NULL,
  `relatedUgID` int(11) NOT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `ug_relatedtopic`
--

INSERT INTO `ug_relatedtopic` VALUES (3,1,197),(4,1,278),(5,1,7),(6,304,67),(7,304,50),(8,179,179),(9,224,114),(10,224,157),(11,224,156),(12,224,156),(13,157,224);

--
-- Table structure for table `ug_topic`
--

CREATE TABLE `ug_topic` (
  `fldid` int(11) NOT NULL AUTO_INCREMENT,
  `code` varchar(8) CHARACTER SET utf8 DEFAULT NULL,
  `name` varchar(30) CHARACTER SET utf8 DEFAULT NULL,
  `parents` varchar(8) CHARACTER SET utf8 DEFAULT '0',
  `module` varchar(8) CHARACTER SET utf8 DEFAULT '0',
  `submenu` smallint(1) DEFAULT '0',
  `urls` varchar(100) CHARACTER SET utf8 DEFAULT '0',
  `urls2` varchar(100) CHARACTER SET utf8 DEFAULT '0',
  `access` varchar(100) CHARACTER SET utf8 DEFAULT NULL,
  `seq` int(11) NOT NULL,
  `display` smallint(1) DEFAULT '1',
  `icons` varchar(32) CHARACTER SET utf8 DEFAULT 'i-film',
  `language` varchar(3) CHARACTER SET utf8 DEFAULT 'EN',
  PRIMARY KEY (`fldid`)
) ENGINE=InnoDB AUTO_INCREMENT=339 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `ug_topic`
--

INSERT INTO `ug_topic` VALUES (1,'DB','Dashboard','0','0',0,'home','home','ALL',1,1,'icon-ug-intro.png','EN'),(2,NULL,'CompanyNew','93','0',0,'0','0',NULL,4,1,'i-film','EN'),(5,'STP','AdminSetup','0','10',1,'#','0','ALL',20,1,'iconsetup.png','EN'),(6,'UM','UserMaster','12','9',0,'admin/usermaster','0','ALL',1,1,'icon-usermaster.png','EN'),(7,'UML','UserMasterList','12','9',0,'admin/usermasterlist','0','ALL',2,1,'icon-usermaster.png','EN'),(12,'ADM','Admin','0','9',1,'#','0','ADMIN',500,1,'iconadmin.png','EN'),(14,'MUL','MenuList','12','9',0,'admin/menumasterlist','0','ALL',4,1,'icon-menulist.png','EN'),(41,'MSLM','LocationMaster','91','4',0,'setting/locationlist','0','ALL',70,1,'iconsetupsub.png','EN'),(45,'GLM','GeneralLedger','0','1',1,'#','0','ALL',100,1,'icongeneralledger.png','EN'),(46,'GLSETUP','GLSetup','45','1',1,'#','0','ALL',90,1,'iconsubsetup.png','EN'),(50,'PUR','Purchasing','0','8',1,'#','0','ALL',30,1,'iconpurchasing.png','EN'),(51,'PURSETUP','PurSetup','50','5',1,'#','0','ALL',90,1,'iconsubsetup.png','EN'),(52,'PURRPT','PurReports','50','5',1,'#','0','ALL',70,1,'iconsubreport.png','EN'),(54,'PURSTSPL','Supplierslist','51','5',0,'supplier/supplierList','0','ALL',51,1,'iconsetupsub.png','EN'),(68,'PURSTUMC','PurUOMCONV','51','5',0,'purchasesetting/umconversionlist','0','ALL',56,1,'iconsetupsub.png','EN'),(80,'ARDASHB','AccountReceivables','0','2',1,'#','0','ALL',80,1,'iconaccountreceivables.png','EN'),(81,'APDASHB','AccountPayables','0','3',1,'#','0','ALL',40,1,'iconaccountpayables.png','EN'),(82,'SALES','SalesOrders','0','5',1,'#','0','ALL',70,1,'iconsalesorder.png','EN'),(83,'GST','GST','0','6',1,'#','0','ALL',70,1,'icongoodserviestax.png','EN'),(84,'ZAKAT','Zakat','0','7',1,'#','0','ALL',400,1,'iconzakatwakaf.png','EN'),(85,'APSETUP','APSetup','81','3',1,'#','0','ALL',90,1,'iconsubsetup.png','EN'),(86,'ARSETUP','ARSetup','80','2',1,'#','0','ALL',90,1,'iconsubsetup.png','EN'),(87,'APRPT','APReports','81','3',1,'#','0','ALL',80,1,'iconsubreport.png','EN'),(88,'GLRPT','GLReports','45','1',1,'#','0','ALL',80,1,'iconsubreport.png','EN'),(89,'ARRPT','ARReports','80','2',1,'#','0','ALL',80,1,'iconsubreport.png','EN'),(90,'INVCTRL','InventoryControl','0','4',1,'#','0','ALL',200,1,'iconinventorycontrol.png','EN'),(91,'ICSETUP','IcSetup','90','4',1,'#','0','ALL',90,1,'iconsubsetup.png','EN'),(92,'ICRPT','IcReports','90','4',1,'#','0','ALL',80,1,'iconsubreport.png','EN'),(93,'MSTRCOMP','CompanySetup','5','10',1,'company/setup','0','ALL',5,1,'icon-com-setup.png','EN'),(94,'GLMCAL','Fycalendar','46','1',0,'glsetting/createCalendar','0','ALL',10,1,'iconsetupsub.png','EN'),(95,'GLHOME','GLHome','45','1',0,'userGuide/GeneralLedger','0','ALL',1,1,'iconsubhome.png','EN'),(96,'ARHOME','ArHome','80','2',0,'AccountReceivables','0','ALL',1,1,'iconsubhome.png','EN'),(97,'APHOME','ApHome','81','3',0,'#','0','ALL',1,1,'iconsubhome.png','EN'),(98,'ICHOME','IcHome','90','4',0,'#','0','ALL',1,1,'iconsubhome.png','EN'),(99,'PURHOME','PurHome','50','5',0,'#','0','ALL',1,1,'iconsubhome.png','EN'),(100,'GSTHOME','GstHome','83','6',0,'#','0','ALL',1,1,'iconsubhome.png','EN'),(102,'GSTSETUP','GstSetup','83','6',1,'#','0','ALL',90,1,'iconsubsetup.png','EN'),(103,'GSTRPT','GstReports','83','6',1,'#','0','ALL',80,1,'iconsubreport.png','EN'),(104,'SOHOME','SoHome','82','5',0,'SalesOrder','0','ALL',1,1,'iconsubhome.png','EN'),(105,'SOSETUP','SoSetup','82','5',1,'#','0','ALL',90,1,'iconsubsetup.png','EN'),(106,'SORPT','SoReports','82','5',1,'#','0','ALL',80,1,'iconsubreport.png','EN'),(107,'ZKTHOME','ZktHome','84','7',0,'#','0','ALL',1,1,'iconsubhome.png','EN'),(108,'ZKTSETUP','ZktSetup','84','7',1,'#','0','ALL',90,1,'iconsubsetup.png','EN'),(109,'ZKTRPT','ZktReports','84','7',1,'#','0','ALL',80,1,'iconsubreport.png','EN'),(110,'MSTRCOMP','CompanyList','93','10',0,'setting/companyList','0','ALL',10,1,'iconcompanysetup.png','EN'),(114,'MSTRSUPP','SupplierSetup','85','3',0,'supplier/supplierList','0','ALL',11,1,'iconsetupsub.png','EN'),(124,'APTRANS','ApTransaction','81','3',1,'#','0','ALL',10,1,'iconsubtransaction.png','EN'),(129,'APSUPPAY','SupplierPayment','124','3',0,'aptransaction/payment','0','ALL',50,1,'icon-transaction.png','EN'),(130,'ARSETCUS','CustomerSetup','86','2',0,'customerSetup/customerList','0','ALL',5,1,'iconsetupsub.png','EN'),(131,'ARTRANS','ArTransaction','80','2',1,'#','0','ALL',10,1,'iconsubtransaction.png','EN'),(141,'APPURDN','PurchaseDebitNote','124','3',0,'aptransaction/newDebitNote','0','ALL',23,1,'icon-transaction.png','EN'),(142,'APPURCN','PurchaseCreditNote','124','3',0,'aptransaction/newCreditNote','0','ALL',25,1,'icon-transaction.png','EN'),(143,'ITEMCAT','ItemCategory','91','4',0,'icsetting/itemCategoryList','0','ALL',5,1,'iconsetupsub.png','EN'),(144,'ITEMTYP','ItemType','91','4',0,'icsetting/itemTypeList','0','ALL',10,1,'iconsetupsub.png','EN'),(145,'ITEMSET','ItemSetup','91','4',0,'icsetting/itemList','0','ALL',25,1,'iconsetupsub.png','EN'),(147,'PURTRANS','PurTransaction','50','5',1,'#','0','ALL',5,1,'iconsubtransaction.png','EN'),(148,'ICTRANS','IcTransaction','90','4',1,'#','0','ALL',5,1,'iconsubtransaction.png','EN'),(150,'GLTRANS','GLTransaction','45','1',1,'#','0','ALL',5,1,'iconsubtransaction.png','EN'),(151,'GSTTRANS','GstTransaction','83','6',1,'#','0','ALL',5,1,'iconsubtransaction.png','EN'),(152,'SOTRANS','SoTransaction','82','5',1,'#','0','ALL',5,1,'iconsubtransaction.png','EN'),(153,'SOQUOT','SalesQuotation','152','5',0,'sotransaction/SalesQuotationList','0','ALL',1,1,'icon-transaction.png','EN'),(154,'GLTRJRNL','JlEntry','150','1',0,'gltransaction/journal','0','',5,1,'icon-transaction.png','EN'),(155,'GLMCALL','Fycalendarlist','46','1',0,'glsetting/financialCalendarList','0','ALL',10,1,'iconsetupsub.png','EN'),(156,'PROJECT','ProjectList','5','0',0,'project/projectlist','0','ALL',50,1,'icon-project.png','EN'),(157,'TERM','Terms','5','0',0,'term/termlist','0','ALL',60,1,'icon-term.png','EN'),(158,'GSTMSTR','Gsttable','102','6',0,'tax/taxtableList','0','ALL',1,1,'iconsetupsub.png','EN'),(159,'GSTTYPE','taxclass','102','6',0,'tax/classList','0','ALL',30,1,'iconsetupsub.png','EN'),(160,'GSTGROUP','taxgroup','102','6',0,'tax/groupList','0','ALL',31,1,'iconsetupsub.png','EN'),(161,'GSTTYPE','taxtype','102','6',0,'tax/typeList','0','ALL',32,1,'iconsetupsub.png','EN'),(162,'INVUM','invuom','91','4',0,'icsetting/unitmeasurelist','0','ALL',70,1,'iconsetupsub.png','EN'),(166,'GLRPBS','Financialposition','88','1',0,'glreports/financialposition','0','',20,1,'iconreport.png','EN'),(167,'GLRPTB','Trialbalance','88','1',0,'glreports/trialBalance','0','ALL',5,1,'iconreport.png','EN'),(168,'GLSTCOA','ChartOfAccount','46','1',0,'glsetting/chartOfAcctList','0','ALL',60,1,'iconsetupsub.png','EN'),(172,'GLTRJlRV','JlReverse','150','1',0,'Gltransaction/reverse','0','',30,1,'icon-transaction.png','EN'),(173,'GLTRPOST','JlPosting','150','1',0,'Gltransaction/posting','0','',40,1,'icon-transaction.png','EN'),(174,'GLRPJLPS','Jlpost','88','1',0,'glreports/postedjournal','0','',40,1,'iconreport.png','EN'),(175,'GLRPJLUP','Jlunposted','88','1',0,'glreports/unpostedjournal','0','',35,1,'iconreport.png','EN'),(176,'GLRPTBFC','Trialbalancefc','88','1',0,'glreports/trialbalanceFiscalyear','0','',7,1,'iconreport.png','EN'),(178,'GLRPABSM','Accountbalancesummary','88','1',0,'glreports/accountBalanceSummary','0','',2,1,'iconreport.png','EN'),(179,'EMP','employeeSetup','5','0',0,'employeeSetup/employeeList','0','',7,1,'icon-employee2.png','EN'),(180,'APPURDNL','PurchaseDebitNoteList','87','3',0,'apreports/debitnoteList','0','',26,1,'iconreport.png','EN'),(181,'APPURDNC','PurchaseDebitNoteConfirm','124','3',0,'aptransaction/debitnotePost','0','',24,1,'icon-transaction.png','EN'),(184,'APPURCNL','PurchaseCreditNoteList','87','3',0,'apreports/creditnoteList','0','',27,1,'iconreport.png','EN'),(185,'APPURCNC','PurchaseCreditNoteConfirm','124','3',0,'aptransaction/creditnotePost','0','',27,1,'icon-transaction.png','EN'),(186,'APPAYCFM','SupplierPaymentConfirm','124','3',0,'aptransaction/supplierpaymentList','0','',51,1,'icon-transaction.png','EN'),(187,'APSUPPAY','SupplierPaymentList','87','3',0,'apreports/supplierpaymentlist','0','',52,1,'iconreport.png','EN'),(189,'GLRPPNLM','Profitnloss','88','1',0,'glreports/profitNloss','0','',30,1,'iconreport.png','EN'),(190,'FORM','formSetup','93','0',0,'companySetup/formSetup','0','',30,1,'i-pen ','EN'),(191,'GLSTBDGT','Budget','46','1',0,'glsetting/budgetEntry','0','',20,1,'iconsetupsub.png','EN'),(192,'APOPWI','NewOtherPaymentWithItem','124','3',0,'othersPayment/newPayWithItem','0','',54,1,'i-pen ','EN'),(193,'APPAYICM','NewOtherPaymentWithItemConfirm','124','3',0,'aptransaction/otherpaywithItemPost','0','',55,1,'icon-transaction.png','EN'),(196,'APRPTOPW','OtherPaymentWithItemList','87','3',0,'othersPayment/otherpaywithList','0','',58,1,'iconreport.png','EN'),(198,'GLRPBGLT','Budgetlist','88','1',0,'glreports/budgetList','0','',70,1,'iconreport.png','EN'),(200,'SOTRNWSO','SalesOrder','152','5',0,'sotransaction/salesOrderList','0','',10,1,'icon-transaction.png','EN'),(201,'INVLOCTR','LocationTransfer','148','4',0,'locationtransfer/add','0','',6,1,'i-film','EN'),(203,'INVPURPR','PurchasePricing','51','8',0,'purchasepricing','0','',10,1,'i-pen ','EN'),(204,'INVITEMC','ItemCountAdjust','148','4',0,'itemcountadjust','0','',8,1,'i-pen ','EN'),(207,'CSSYSGEN','SystemGeneral','93','0',0,'systemgeneral/generalSetup','0','',31,1,'i-pen ','EN'),(208,'APRPTSTL','SupplierStatementList','87','3',0,'supplierStatement/supplierList','0','',53,1,'iconreport.png','EN'),(209,'SOTRQOLT','Salesquotelist','106','5',0,'soreport/SalesQuotationList','0','ALL',17,1,'iconreport.png','EN'),(210,'SOSTSLPC','SoSalesprice','105','5',0,'sosetup/SalesPrice','0','',10,1,'iconsetupsub.png','EN'),(211,'SORPPCLT','SrSalesprice','106','5',0,'soreport/SalesPriceList','0','',10,1,'iconreport.png','EN'),(212,'CHAOFACC','ChartOfAccountSetup','93','1',0,'setting/chartOfAccountsSetup','0','',29,1,'i-film','EN'),(216,'SOTRDOLT','DeliveryOrderList','106','5',0,'sotransaction/SalesDOList','0','ALL',19,1,'iconreport.png','EN'),(217,'SOTRDO','DeliveryOrder','152','5',0,'sotransaction/SalesDO','0','ALL',40,1,'icon-transaction.png','EN'),(218,'PURORDER','PurchaseOrder','147','5',0,'PO_Transaction/newPO','0','',6,1,'icon-transaction.png','EN'),(219,'PURORLST','PurchaseOrderList','52','5',0,'purchaseReports/poLIST/rpt','0','',7,1,'iconreport.png','EN'),(220,'PURRCV','PurchaseReceive','147','5',0,'receiveItems/newITemReceived','0','',9,1,'i-pen ','EN'),(224,'APPURINV','PurchaseInvoice','124','3',0,'purchaseinvoice','0','',19,1,'i-pen ','EN'),(225,'APDIRINV','DirectPurchaseInvoice','124','3',0,'Aptransaction/invoices','0','',20,1,'icon-transaction.png','EN'),(227,'ARSALINV','SalesInvoice','131','2',0,'artransaction/salesinvoice','0','',10,1,'icon-transaction.png','EN'),(229,'ARSDBN','SalesDebitNote','131','2',0,'artransaction/newSaleDebitNote','0','',19,1,'icon-transaction.png','EN'),(230,'ARDBNC','SalesDebitNoteConfirm','131','2',0,'artransaction/salesdebitnotePost','0','',20,1,'i-pen ','EN'),(231,'ARSCN','SalesCreditNote','131','2',0,'artransaction/newSaleCreditNote','0','',21,1,'i-pen ','EN'),(232,'ARSCNC','SalesCreditNoteConfirm','131','2',0,'artransaction/salescreditnotePost','0','',22,1,'icon-transaction.png','EN'),(233,'ARRCVP','ReceivePayment','131','2',0,'artransaction/newReceivePayment','0','',23,1,'icon-transaction.png','EN'),(234,'ARRCVPC','ReceivePaymentConfirm','131','2',0,'artransaction/receivedPaymentPost','0','',24,1,'icon-transaction.png','EN'),(235,'ARINVLST','DirectSalesInvoiceList','89','2',0,'salesInvoice/salesInvoiceList','0','',18,1,'iconreport.png','EN'),(236,'ARDBNLST','SalesDebitNoteList','89','2',0,'salesInvoice/salesdebitnotelist','0','',26,1,'iconreport.png','EN'),(237,'ARCDNLST','SalesCreditNoteList','89','2',0,'salesInvoice/salescreditnoteList','0','',27,1,'iconreport.png','EN'),(238,'ARRCVPLS','ReceivePaymentList','89','2',0,'arReports/compRecPaymentList','0','',28,1,'iconreport.png','EN'),(239,'ARDSLINV','NewDirectSaleInvoice','131','2',0,'arTransaction/newDirectSaleInvoice','0','',13,1,'icon-transaction.png','EN'),(240,'AGENTSTP','AgentSetup','5','0',0,'saleagentSetup/agentList','0','',32,1,'icon-agent.png','EN'),(241,'SOTRSOLT','Saleslist','106','5',0,'soreport/SalesOrderList','0','ALL',18,1,'iconreport.png','EN'),(243,'INVPLNRP','InventoryPlanningReport','92','4',0,'inventory/rptstatus','0','',81,1,'iconreport.png','EN'),(244,'INVVALRP','InventoryValuationReport','92','4',0,'inventory/rptinventorysummary','0','',82,1,'iconreport.png','EN'),(245,'INVSTORP','StockCheckReport','92','4',0,'inventory/stocklist','0','',84,1,'iconreport.png','EN'),(248,'INVOUTRP','InvOutstandingGRNReport','92','4',0,'inventory/rptgrnvaluationFromInventory','0','',87,1,'iconreport.png','EN'),(249,'INVMOVRP','InventoryMovementReport','92','4',0,'inventory/rptmovement','0','',88,1,'iconreport.png','EN'),(250,'INVLSTRP','InventoryList','92','4',0,'inventory/rptbylocation','0','',89,1,'iconreport.png','EN'),(251,'PURORDCF','PurchaseOrderConfirm','147','5',0,'po_transaction/poList/post','0','',8,1,'icon-transaction.png','EN'),(252,'PURRCVC','PurchaseReceiveConfirm','147','5',0,'purchasetransaction/receiveItemPosting','0','',10,1,'icon-transaction.png','EN'),(253,'PURRCVLS','PurchaseReceiveList','52','5',0,'receiveItems/receiveItemList2','0','',8,1,'iconreport.png','EN'),(255,'GLSTCURC','Currencyconversion','46','1',0,'glsetting/currencyConvertion','0','',50,1,'iconsetupsub.png','EN'),(256,'ARDRSINV','SaleInvoiceConfirm','131','2',0,'artransaction/directsalesinvPost','0','',15,1,'icon-transaction.png','EN'),(257,'TXTRPROC','GAFFiles','151','0',0,'taxTransaction/processGAF','0','',10,1,'icon-transaction.png','EN'),(258,'APPURINV','PurchaseInvoiceList','87','3',0,'purchasetransaction/purchaseinvoicelist','0','',25,1,'iconreport.png','EN'),(259,'SORPSOCU','Salesbycustomer','106','5',0,'soreport/SalesByCustomer','0','',20,1,'iconreport.png','EN'),(260,'DELCNFRM','DeliveryOrderConfirm','152','0',0,'sotransaction/salesDOPost','0','',42,1,'icon-transaction.png','EN'),(261,'SORPYRSL','SalesbycustomerYears','106','5',0,'soreport/SalesByCustomerYears','0','',25,1,'iconreport.png','EN'),(263,'SORPSLIT','Salesbyitem','106','5',0,'soreport/SalesByItem','0','',26,1,'iconreport.png','EN'),(264,'INVLOCTC','LocationTransferConfirm','148','4',0,'locationtransfer/locationtransfer','0','',7,1,'i-film','EN'),(265,'INVITCC','ItemCountAdjustConfirm','148','4',0,'itemcountadjust/confirm','0','',9,1,'i-film','EN'),(268,'IVSTCKCS','StockCountSheet','92','4',0,'countsheet','0','',83,1,'iconreport.png','EN'),(269,'LTL','LocationTransferList','92','4',0,'locationtransfer/report','0','',10,1,'iconreport.png','EN'),(270,'ICAA','ItemCountAndAdjustmentList','92','4',0,'itemcountadjust/report','0','',20,1,'iconreport.png','EN'),(272,'BNKSETUP','BankSetup','5','10',0,'bankSetup/bankList','0','',78,1,'icon-bank.png','EN'),(274,'ZKTSTGRP','Zakatgroup','108','7',0,'zakatsetup/Group','0','',30,1,'iconsetupsub.png','EN'),(275,'ZKTSTNSB','nisab','108','7',0,'zakatsetup/nisab','0',NULL,20,1,'iconsetupsub.png','EN'),(276,'ZKTRGPLT','Zakatgrouplist','109','7',0,'zakatreport/groupList','0','',20,1,'iconreport.png','EN'),(277,'ZKTSTNSD','Nisabdetails','108','7',0,'zakatsetup/NisabDetails','0','',10,1,'iconsetupsub.png','EN'),(278,'ZKTTRANS','ZktTransaction','84','7',1,'#','0','',20,1,'iconsubtransaction.png','EN'),(279,'ZKTTRCAL','Zakatcalculate','278','7',0,'zakatTransaction/Calculation','0','',10,1,'icon-transaction.png','EN'),(280,'ZKSTCNTR','ZcZakatcenter','108','7',0,'zakatsetup/Center','0','',55,1,'iconsetupsub.png','EN'),(281,'ZKRPCTRL','ZrZakatcenter','109','7',0,'zakatreport/centerList','0','',10,1,'iconreport.png','EN'),(282,'ZKRPNBLT','Zakatnisab','109','7',0,'zakatreport/nisabList','0','',5,1,'iconreport.png','EN'),(283,'ZKRPSMLT','Zakatsummary','109','7',0,'zakatreport/zakatSummaryList','0','',80,1,'iconreport.png','EN'),(284,'PUROUTGR','PurOutstandingGRNReport','52','5',0,'inventory/rptgrnvaluationFromPurchase','0','',10,1,'iconreport.png','EN'),(285,'WKSTMSTR','Wakafsetup','108','7',0,'wakafsetup/wakaf_acrual_list','0','',60,1,'iconsetupsub.png','EN'),(286,'ARCUSTST','CustomerStatement','89','2',0,'customerStatement/customerList','0','',29,1,'iconreport.png','EN'),(287,'ARCPYSI','copySalesInvoice','131','2',0,'arinvoiceclone','0','',14,1,'i-film','EN'),(288,'APCPYPI','copyPurchaseInvoice','124','3',0,'apinvoiceclone','0','',21,1,'i-film','EN'),(289,'SORPORCT','Salesorderbycustomer','106','5',0,'soreport/SalesOrderByCustomer','0','',60,1,'iconreport.png','EN'),(290,'SORPSOIT','Salesorderbyitem','106','5',0,'soreport/SalesOrderByItem','0','',65,1,'iconreport.png','EN'),(292,'SORPOROT','Salesorderoutstandingbyitem','106','5',0,'soreport/SalesOrderOutstandingByItem','0','',75,1,'iconreport.png','EN'),(295,'WCQCNTR','WaqafCenter','108','0',0,'waqafsetup/waqaflist','0','',61,1,'iconsetupsub.png','EN'),(297,'WKFCAL','wakafCalculation','278','0',0,'wakafSetup/newwakaf','0','',11,1,'i-film','EN'),(298,'WKFLST','wakafList','109','0',0,'wakafSetup/wakafList','0','',81,1,'iconreport.png','EN'),(299,'APDRNOTE','PurchaseDebitNoteEdit','124','3',0,'aptransaction/editDebitNote','0','',100,0,'icon-transaction.png','EN'),(302,'GLTRYECL','YearEndClose','150','1',0,'Gltransaction/YearEndClose','0','0',90,1,'icon-transaction.png','EN'),(304,'LOGRPT','LogReport','12','9',0,'logreport','0','0',5,1,'icon-log.png','EN'),(305,'INSTALL','installation','0','0',0,'0','0',NULL,10,1,'icon-ug-install.png','EN'),(306,'HTS','HowToStart','0','0',0,'0','0',NULL,15,1,'icon-how-to.png','EN'),(307,'GSTBDREL','baddebtrelief','151','0',0,'0','0',' ',11,1,'icon-transaction.png','EN'),(308,'BDBTRLC','baddebtreliefcon','151','0',0,'0','0',NULL,12,1,'icon-transaction.png','EN'),(309,'BADBTRCV','baddebtrecover','151','0',0,'0','0',NULL,13,1,'icon-transaction.png','EN'),(310,'BDBTRCCF','baddebtrecovercon','151','0',0,'0','0',NULL,14,1,'icon-transaction.png','EN'),(311,'GSTREPT','gstReport','103','0',0,'0','0',NULL,81,1,'iconsubreport.png','EN'),(312,'GST03','gst03','103','0',0,'0','0',NULL,82,1,'iconreport.png','EN'),(313,'BDRL','baddebtreliefrpt','103','0',0,'0','0',NULL,83,1,'iconreport.png','EN'),(314,'BDRCLRPT','baddebtrecoverrpt','103','0',0,'0','0',NULL,84,1,'iconreport.png','EN'),(315,'ARCSHS','CashSalesRpt','89','2',0,'arreports/cashsalelist','0',NULL,31,1,'i-film','EN'),(316,'ARCASH','CashSale','131','2',0,'arTransaction/newcashsale','0',NULL,25,1,'i-film','EN'),(317,'ARCASHSC','CashSalesConfirm','131','2',0,'artransaction/cashsalePost','0',NULL,26,1,'i-film','EN'),(318,'APOPWOI','NewOtherPaymentWithoutItem','150','1',0,'gltransaction/newPayWithoutItem','0',NULL,56,1,'i-film','EN'),(319,'OTRPAY','otherpaymentconfirm','150','1',0,'gltransaction/otherpaymentConfirm','0',NULL,57,1,'i-film','EN'),(320,'OTHRCV','othersReceive','150','1',0,'gltransaction/newotherreceive','0',NULL,58,1,'i-film','EN'),(321,'OTRCVCON','othersReceiveConfirm','150','1',0,'gltransaction/otherreceiveConfirm','0',NULL,59,1,'i-film','EN'),(322,'APBANKRE','BankReconciliation','88','1',0,'BankReconciliation','0',NULL,57,1,'i-film','EN'),(323,'GLBNKRCL','bankreconlist','88','1',0,'bankreconciliation/concilelist','0',NULL,58,1,'i-film','EN'),(324,'APRPTOPW','ArOtherPaymentWithoutItemList','88','1',0,'glreports/otherpaywithoutList','0',NULL,59,1,'i-film','EN'),(325,'OTRCVLST','othersReceiveList','88','1',0,'glreports/othersreceiveList','0',NULL,71,1,'i-film','EN'),(326,'PURRRPT','purchasePricingReport','52','5',0,'purchasepricing/report','0',NULL,5,1,'i-film','EN'),(327,'PURRCVCA','purchaseReceiveCancel','52','8',0,'receiveItems/receivecancel','0',NULL,9,1,'i-film','EN'),(328,'PURCNCL','purchaseOrderCancel','52','8',0,'purchaseReports/poCancelList','0',NULL,10,1,'i-film','EN'),(329,'ShipToST','shiptosetup','5','1',0,'setting/shiptoList','0',NULL,79,1,'icon-ship.png','EN'),(331,'BACKUP','backup','12','9',0,'backup','0',NULL,6,1,'icon-backup.png','EN'),(332,'ARCUSTAG','CustomerAging','89','2',0,'arreports/customerAging','0',NULL,30,1,'i-film','EN'),(334,'IVUNTMSR','unitmeasures','91','4',0,'icsetting/unitmeasurelist','0',NULL,71,1,'i-film','EN'),(335,'APDRINVC','PurchaseInvoiceConfirm','124','3',0,'aptransaction/invoicesConfirm','0',NULL,22,1,'i-film','EN'),(336,'ItemDetR','Itemdetails','92','4',0,'icsetting/ItemDetails','0',NULL,6,1,'i-film','EN'),(337,'GLOPNBAL','glopeningbalance','46','1',0,'glsetting/openingBalance','0',NULL,61,1,'i-film','EN'),(338,NULL,'resetpassword','0','0',0,'0','0',NULL,16,1,'icon-how-to.png','EN');

--
-- 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=130 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,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(2,1,1,2,1,1,1,0,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(3,1,1,3,1,1,1,0,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(4,1,1,4,1,1,1,0,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(5,1,1,5,1,1,1,0,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(6,1,1,6,1,1,1,0,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(7,1,1,7,1,1,1,0,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(8,1,1,8,1,1,1,0,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(9,1,1,9,1,1,1,0,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(10,1,1,10,1,1,1,0,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(11,1,1,0,0,0,0,0,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(100,3,1,1,0,0,0,0,1,'2016-07-18 06:05:28',1,'2016-07-18 06:32:00'),(101,3,1,2,0,0,0,0,1,'2016-07-18 06:05:31',1,'2016-07-18 06:32:03'),(102,3,1,3,0,0,0,0,1,'2016-07-18 06:05:33',1,'2016-07-18 06:32:05'),(103,3,1,4,0,0,0,0,1,'2016-07-18 06:05:36',1,'2016-07-18 06:32:06'),(104,3,1,5,0,0,0,0,1,'2016-07-18 06:05:38',1,'2016-07-18 06:32:08'),(105,3,1,6,0,0,0,0,1,'2016-07-18 06:05:39',1,'2016-07-18 06:32:09'),(106,3,1,7,0,0,0,0,1,'2016-07-18 06:05:42',1,'2016-07-18 06:32:12'),(107,3,1,8,0,0,0,0,1,'2016-07-18 06:05:43',1,'2016-07-18 06:32:13'),(108,3,1,9,0,0,0,0,1,'2016-07-18 06:05:45',1,'2016-07-18 06:32:15'),(109,3,1,10,0,0,0,0,1,'2016-07-18 06:05:47',1,'2016-07-18 06:32:16'),(110,3,75,1,1,1,1,0,1,'2016-07-18 06:09:56',0,'2016-07-18 06:09:56'),(111,3,75,2,1,1,1,0,1,'2016-07-18 06:09:59',0,'2016-07-18 06:09:59'),(112,3,75,3,1,1,1,0,1,'2016-07-18 06:10:02',0,'2016-07-18 06:10:02'),(113,3,75,4,1,1,1,0,1,'2016-07-18 06:10:04',0,'2016-07-18 06:10:04'),(114,3,75,5,1,1,1,0,1,'2016-07-18 06:10:06',0,'2016-07-18 06:10:06'),(115,3,75,6,1,1,1,0,1,'2016-07-18 06:10:08',0,'2016-07-18 06:10:08'),(116,3,75,7,1,1,1,0,1,'2016-07-18 06:10:09',0,'2016-07-18 06:10:09'),(117,3,75,8,1,1,1,0,1,'2016-07-18 06:10:10',0,'2016-07-18 06:10:10'),(118,3,75,9,1,1,1,0,1,'2016-07-18 06:10:11',0,'2016-07-18 06:10:11'),(119,3,75,10,1,1,1,0,1,'2016-07-18 06:10:12',0,'2016-07-18 06:10:12'),(120,3,76,1,1,1,1,0,75,'2016-07-18 08:29:11',0,'2016-07-18 08:29:11'),(121,3,76,2,1,1,1,0,75,'2016-07-18 08:29:13',0,'2016-07-18 08:29:13'),(122,3,76,3,1,1,1,0,75,'2016-07-18 08:29:15',0,'2016-07-18 08:29:15'),(123,3,76,4,1,1,1,0,75,'2016-07-18 08:29:17',0,'2016-07-18 08:29:17'),(124,3,76,5,1,1,1,0,75,'2016-07-18 08:29:18',0,'2016-07-18 08:29:18'),(125,3,76,6,1,1,1,0,75,'2016-07-18 08:29:19',0,'2016-07-18 08:29:19'),(126,3,76,7,1,1,1,0,75,'2016-07-18 08:29:21',0,'2016-07-18 08:29:21'),(127,3,76,8,1,1,1,0,75,'2016-07-18 08:29:22',0,'2016-07-18 08:29:22'),(128,3,76,9,1,1,1,0,75,'2016-07-18 08:29:23',0,'2016-07-18 08:29:23'),(129,3,76,10,1,1,1,0,75,'2016-07-18 08:29:24',0,'2016-07-18 08:29:24');

--
-- 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=737 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,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(2,1,1,'ARDBNLST',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(3,1,1,'ARCDNLST',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(4,1,1,'ARRCVPLS',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(5,1,1,'ARCUSTST',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(6,1,1,'APSUPPAY',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(7,1,1,'APPURDN',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(8,1,1,'APPURCN',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(9,1,1,'APPURDNC',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(10,1,1,'APPURCNC',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(11,1,1,'APOPWI',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(12,1,1,'APOPWIC',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(13,1,1,'APOPWOI',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(14,1,1,'APPURINV',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(15,1,1,'APDIRINV',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(16,1,1,'APCPYPI',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(17,1,1,'APBANKRE',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(18,1,1,'APPAYCFM',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(19,1,1,'APPAYICM',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(20,1,1,'APDRNOTE',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(21,1,1,'GLTRJRNL',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(22,1,1,'GLTRJlCY',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(23,1,1,'GLTRJlRV',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(24,1,1,'GLTRPOST',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(25,1,1,'GLRPBS',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(26,1,1,'GLRPTB',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(27,1,1,'GLRPJLPS',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(28,1,1,'GLRPJLUP',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(29,1,1,'GLRPTBFC',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(30,1,1,'GLRPABSM',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(31,1,1,'GLRPPNLM',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(32,1,1,'GLRPBGLT',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(33,1,1,'GLMCAL',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(34,1,1,'GLMCALL',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(35,1,1,'GLSTCOA',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(36,1,1,'GLSTBDGT',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(37,1,1,'GLSTCURC',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(38,1,1,'ARSALINV',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(39,1,1,'ARSDBN',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(40,1,1,'ARDBNC',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(41,1,1,'ARSCN',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(42,1,1,'ARSCNC',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(43,1,1,'ARRCVP',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(44,1,1,'ARRCVPC',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(45,1,1,'ARDSLINV',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(46,1,1,'ARDRSINV',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(47,1,1,'ARCPYSI',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(48,1,1,'ARSETCUS',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(49,1,1,'MSTRSUPP',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(50,1,1,'APPURDNL',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(51,1,1,'APPURCNL',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(52,1,1,'APRPTOPW',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(53,1,1,'APRPTSTL',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(54,1,1,'APTRETCR',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(55,1,1,'APTRPYIE',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(56,1,1,'UM',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(57,1,1,'UML',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(58,1,1,'MUL',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(59,1,1,'LOGRPT',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(60,1,1,'UMACCSS',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(61,1,1,'MSCL',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(62,1,1,'MSSL',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(63,1,1,'MSTRCOMP',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(64,1,1,'PROJECT',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(65,1,1,'TERM',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(66,1,1,'MSMTRCD',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(67,1,1,'EMP',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(68,1,1,'AGENTSTP',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(69,1,1,'BNKSETUP',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(70,1,1,'ADMMENU',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(71,1,1,'APTRPYOE',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(72,1,1,'INVPLNRP',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(73,1,1,'INVVALRP',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(74,1,1,'INVSTORP',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(75,1,1,'INVOUTRP',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(76,1,1,'INVMOVRP',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(77,1,1,'INVLSTRP',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(78,1,1,'IVSTCKCS',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(79,1,1,'LTL',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(80,1,1,'ICAA',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(81,1,1,'MSLM',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(82,1,1,'ITEMCAT',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(83,1,1,'ITEMTYP',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(84,1,1,'ITEMSET',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(85,1,1,'INVUM',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(86,1,1,'INVUMCOV',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(87,1,1,'INUMCVLS',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(88,1,1,'ICSTIDTL',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(89,1,1,'ARNWCUST',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(90,1,1,'ARSHIP2L',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(91,1,1,'ARSHIP2N',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(92,1,1,'ADMBNKMS',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(93,1,1,'ARTRINED',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(94,1,1,'AREDSLDR',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(95,1,1,'AREDCR',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(96,1,1,'ARPAYEDT',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(97,1,1,'PURORDER',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(98,1,1,'PURRCV',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(99,1,1,'PURORDCF',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(100,1,1,'PURRCVC',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(101,1,1,'GSPRJNW',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(102,1,1,'ZKTSTGRP',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(103,1,1,'ZKTSTNSB',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(104,1,1,'ZKTSTNSD',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(105,1,1,'ZKSTCNTR',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(106,1,1,'WKSTMSTR',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(107,1,1,'WCQCNTR',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(108,1,1,'APNEWSUP',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(109,1,1,'APNWSHP2',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(110,1,1,'GLTRYECL',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(111,1,1,'INVLOCTR',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(112,1,1,'INVSALEP',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(113,1,1,'INVPURPR',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(114,1,1,'INVITEMC',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(115,1,1,'INVLOCTC',0,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(116,1,1,'INVITCC',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(117,1,1,'INVSALC',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(118,1,1,'INVPURCC',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(119,1,1,'ItemDetR',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(120,1,1,'INEDITEM',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(121,1,1,'INNWITEM',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(122,1,1,'PURSTSPL',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(123,1,1,'PURSTUM',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(124,1,1,'PURSTUMC',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(125,1,1,'UMCONVNW',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(126,1,1,'SOSTSLPC',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(127,1,1,'PURORLST',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(128,1,1,'PURRCVLS',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(129,1,1,'PUROUTGR',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(130,1,1,'PUPRRPT',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(131,1,1,'TERMNEW',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(132,1,1,'APDRINVC',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(133,1,1,'SOQUOT',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(134,1,1,'SOTRNWSO',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(135,1,1,'SOTRDO',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(136,1,1,'DELCNFRM',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(137,1,1,'ZKTTRCAL',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(138,1,1,'WKFCAL',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(139,1,1,'ZKTRGPLT',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(140,1,1,'ZKRPCTRL',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(141,1,1,'ZKRPNBLT',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(142,1,1,'ZKRPSMLT',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(143,1,1,'WKFLST',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(144,1,1,'WCQCTRNW',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(145,1,1,'TXTRPROC',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(146,1,1,'GST03',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(147,1,1,'gstrpt',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(148,1,1,'null',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(149,1,1,'GSTMSTR',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(150,1,1,'GSTTYPE',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(151,1,1,'GSTGROUP',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(152,1,1,'SOTRQOLT',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(153,1,1,'SORPPCLT',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(154,1,1,'SOTRDOLT',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(155,1,1,'SOTRSOLT',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(156,1,1,'SORPSOCU',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(157,1,1,'SORPYRSL',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(158,1,1,'SORPSLIT',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(159,1,1,'SORPORCT',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(160,1,1,'SORPSOIT',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(161,1,1,'SORPOROT',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(162,1,1,'ARCUSTAG',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(163,1,1,'GSTCLASS',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(164,1,1,'TAXMSNW',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(165,1,1,'SOSLSPRC',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(166,1,1,'ARCASH',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(167,1,1,'ARCASHSC',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(168,1,1,'OTRPAY',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(169,1,1,'OTHRCV',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(170,1,1,'OTRCVCON',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(171,1,1,'ARCSHS',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(172,1,1,'OTRCVLST',1,1,'2016-07-18 05:32:35',1,'2016-07-18 05:32:35'),(173,3,1,'GLTRJRNL',0,1,'2016-07-18 06:05:28',0,'2016-07-18 06:32:00'),(174,3,1,'GLTRJlCY',0,1,'2016-07-18 06:05:28',0,'2016-07-18 06:32:00'),(175,3,1,'GLTRJlRV',0,1,'2016-07-18 06:05:28',0,'2016-07-18 06:32:00'),(176,3,1,'GLTRPOST',0,1,'2016-07-18 06:05:28',0,'2016-07-18 06:32:00'),(177,3,1,'APOPWOI',0,1,'2016-07-18 06:05:28',0,'2016-07-18 06:32:00'),(178,3,1,'GLTRYECL',0,1,'2016-07-18 06:05:28',0,'2016-07-18 06:32:01'),(179,3,1,'OTRPAY',0,1,'2016-07-18 06:05:28',0,'2016-07-18 06:32:01'),(180,3,1,'OTHRCV',0,1,'2016-07-18 06:05:28',0,'2016-07-18 06:32:01'),(181,3,1,'OTRCVCON',0,1,'2016-07-18 06:05:28',0,'2016-07-18 06:32:01'),(182,3,1,'GLRPBS',0,1,'2016-07-18 06:05:28',0,'2016-07-18 06:32:01'),(183,3,1,'GLRPTB',0,1,'2016-07-18 06:05:28',0,'2016-07-18 06:32:01'),(184,3,1,'GLRPJLPS',0,1,'2016-07-18 06:05:28',0,'2016-07-18 06:32:01'),(185,3,1,'GLRPJLUP',0,1,'2016-07-18 06:05:28',0,'2016-07-18 06:32:01'),(186,3,1,'GLRPTBFC',0,1,'2016-07-18 06:05:28',0,'2016-07-18 06:32:01'),(187,3,1,'GLRPABSM',0,1,'2016-07-18 06:05:28',0,'2016-07-18 06:32:01'),(188,3,1,'GLRPPNLM',0,1,'2016-07-18 06:05:29',0,'2016-07-18 06:32:01'),(189,3,1,'APRPTOPW',0,1,'2016-07-18 06:05:29',0,'2016-07-18 06:32:01'),(190,3,1,'GLRPBGLT',0,1,'2016-07-18 06:05:29',0,'2016-07-18 06:32:01'),(191,3,1,'APBANKRE',0,1,'2016-07-18 06:05:29',0,'2016-07-18 06:32:01'),(192,3,1,'OTRCVLST',0,1,'2016-07-18 06:05:29',0,'2016-07-18 06:32:01'),(193,3,1,'GLBNKRCL',0,1,'2016-07-18 06:05:29',0,'2016-07-18 06:32:01'),(194,3,1,'TRSCSUMM',0,1,'2016-07-18 06:05:29',0,'2016-07-18 06:32:01'),(195,3,1,'GLMCAL',0,1,'2016-07-18 06:05:29',0,'2016-07-18 06:32:01'),(196,3,1,'GLMCALL',0,1,'2016-07-18 06:05:29',0,'2016-07-18 06:32:01'),(197,3,1,'GLSTCOA',0,1,'2016-07-18 06:05:29',0,'2016-07-18 06:32:01'),(198,3,1,'GLSTBDGT',0,1,'2016-07-18 06:05:29',0,'2016-07-18 06:32:01'),(199,3,1,'GLSTCURC',0,1,'2016-07-18 06:05:29',0,'2016-07-18 06:32:01'),(200,3,1,'GLOPNBAL',0,1,'2016-07-18 06:05:29',0,'2016-07-18 06:32:01'),(201,3,1,'GLUNPRES',0,1,'2016-07-18 06:05:29',0,'2016-07-18 06:32:01'),(202,3,1,'ARSALINV',0,1,'2016-07-18 06:05:31',0,'2016-07-18 06:32:03'),(203,3,1,'ARSDBN',0,1,'2016-07-18 06:05:31',0,'2016-07-18 06:32:03'),(204,3,1,'ARDBNC',0,1,'2016-07-18 06:05:31',0,'2016-07-18 06:32:03'),(205,3,1,'ARSCN',0,1,'2016-07-18 06:05:31',0,'2016-07-18 06:32:03'),(206,3,1,'ARSCNC',0,1,'2016-07-18 06:05:31',0,'2016-07-18 06:32:03'),(207,3,1,'ARRCVP',0,1,'2016-07-18 06:05:31',0,'2016-07-18 06:32:03'),(208,3,1,'ARRCVPC',0,1,'2016-07-18 06:05:31',0,'2016-07-18 06:32:03'),(209,3,1,'ARDSLINV',0,1,'2016-07-18 06:05:31',0,'2016-07-18 06:32:03'),(210,3,1,'ARDRSINV',0,1,'2016-07-18 06:05:31',0,'2016-07-18 06:32:03'),(211,3,1,'ARCPYSI',0,1,'2016-07-18 06:05:31',0,'2016-07-18 06:32:03'),(212,3,1,'ARTRINED',0,1,'2016-07-18 06:05:31',0,'2016-07-18 06:32:03'),(213,3,1,'AREDSLDR',0,1,'2016-07-18 06:05:31',0,'2016-07-18 06:32:03'),(214,3,1,'AREDCR',0,1,'2016-07-18 06:05:31',0,'2016-07-18 06:32:03'),(215,3,1,'ARPAYEDT',0,1,'2016-07-18 06:05:31',0,'2016-07-18 06:32:03'),(216,3,1,'ARCASH',0,1,'2016-07-18 06:05:31',0,'2016-07-18 06:32:03'),(217,3,1,'ARCASHSC',0,1,'2016-07-18 06:05:31',0,'2016-07-18 06:32:03'),(218,3,1,'ARINVLST',0,1,'2016-07-18 06:05:32',0,'2016-07-18 06:32:03'),(219,3,1,'ARDBNLST',0,1,'2016-07-18 06:05:32',0,'2016-07-18 06:32:03'),(220,3,1,'ARCDNLST',0,1,'2016-07-18 06:05:32',0,'2016-07-18 06:32:03'),(221,3,1,'ARRCVPLS',0,1,'2016-07-18 06:05:32',0,'2016-07-18 06:32:03'),(222,3,1,'ARCUSTST',0,1,'2016-07-18 06:05:32',0,'2016-07-18 06:32:03'),(223,3,1,'ARCUSTAG',0,1,'2016-07-18 06:05:32',0,'2016-07-18 06:32:03'),(224,3,1,'ARCSHS',0,1,'2016-07-18 06:05:32',0,'2016-07-18 06:32:03'),(225,3,1,'ARSETCUS',0,1,'2016-07-18 06:05:32',0,'2016-07-18 06:32:03'),(226,3,1,'ARNWCUST',0,1,'2016-07-18 06:05:32',0,'2016-07-18 06:32:03'),(227,3,1,'ARSHIP2L',0,1,'2016-07-18 06:05:32',0,'2016-07-18 06:32:03'),(228,3,1,'ARSHIP2N',0,1,'2016-07-18 06:05:32',0,'2016-07-18 06:32:03'),(229,3,1,'ARHISTCU',0,1,'2016-07-18 06:05:32',0,'2016-07-18 06:32:03'),(230,3,1,'APSUPPAY',0,1,'2016-07-18 06:05:34',0,'2016-07-18 06:32:05'),(231,3,1,'APPURDN',0,1,'2016-07-18 06:05:34',0,'2016-07-18 06:32:05'),(232,3,1,'APPURCN',0,1,'2016-07-18 06:05:34',0,'2016-07-18 06:32:05'),(233,3,1,'APPURDNC',0,1,'2016-07-18 06:05:34',0,'2016-07-18 06:32:05'),(234,3,1,'APPURCNC',0,1,'2016-07-18 06:05:34',0,'2016-07-18 06:32:05'),(235,3,1,'APPAYCFM',0,1,'2016-07-18 06:05:34',0,'2016-07-18 06:32:05'),(236,3,1,'APOPWI',0,1,'2016-07-18 06:05:34',0,'2016-07-18 06:32:05'),(237,3,1,'APPAYICM',0,1,'2016-07-18 06:05:34',0,'2016-07-18 06:32:05'),(238,3,1,'APPURINV',0,1,'2016-07-18 06:05:34',0,'2016-07-18 06:32:05'),(239,3,1,'APDIRINV',0,1,'2016-07-18 06:05:34',0,'2016-07-18 06:32:05'),(240,3,1,'APDRINVC',0,1,'2016-07-18 06:05:34',0,'2016-07-18 06:32:05'),(241,3,1,'APCPYPI',0,1,'2016-07-18 06:05:34',0,'2016-07-18 06:32:05'),(242,3,1,'APDRNOTE',0,1,'2016-07-18 06:05:34',0,'2016-07-18 06:32:05'),(243,3,1,'APTRETCR',0,1,'2016-07-18 06:05:34',0,'2016-07-18 06:32:05'),(244,3,1,'APTRPYIE',0,1,'2016-07-18 06:05:34',0,'2016-07-18 06:32:05'),(245,3,1,'APTRPYOE',0,1,'2016-07-18 06:05:34',0,'2016-07-18 06:32:05'),(246,3,1,'APPURDNL',0,1,'2016-07-18 06:05:34',0,'2016-07-18 06:32:05'),(247,3,1,'APPURCNL',0,1,'2016-07-18 06:05:34',0,'2016-07-18 06:32:05'),(248,3,1,'APRPTSTL',0,1,'2016-07-18 06:05:34',0,'2016-07-18 06:32:05'),(249,3,1,'MSTRSUPP',0,1,'2016-07-18 06:05:34',0,'2016-07-18 06:32:05'),(250,3,1,'APNEWSUP',0,1,'2016-07-18 06:05:34',0,'2016-07-18 06:32:05'),(251,3,1,'APNWSHP2',0,1,'2016-07-18 06:05:34',0,'2016-07-18 06:32:05'),(252,3,1,'APHISTSU',0,1,'2016-07-18 06:05:34',0,'2016-07-18 06:32:05'),(253,3,1,'INVLOCTR',0,1,'2016-07-18 06:05:36',0,'2016-07-18 06:32:06'),(254,3,1,'INVITEMC',0,1,'2016-07-18 06:05:36',0,'2016-07-18 06:32:06'),(255,3,1,'INVLOCTC',0,1,'2016-07-18 06:05:36',0,'2016-07-18 06:32:06'),(256,3,1,'INVITCC',0,1,'2016-07-18 06:05:36',0,'2016-07-18 06:32:06'),(257,3,1,'INVPLNRP',0,1,'2016-07-18 06:05:36',0,'2016-07-18 06:32:06'),(258,3,1,'INVVALRP',0,1,'2016-07-18 06:05:36',0,'2016-07-18 06:32:06'),(259,3,1,'INVSTORP',0,1,'2016-07-18 06:05:36',0,'2016-07-18 06:32:07'),(260,3,1,'INVOUTRP',0,1,'2016-07-18 06:05:36',0,'2016-07-18 06:32:07'),(261,3,1,'INVMOVRP',0,1,'2016-07-18 06:05:36',0,'2016-07-18 06:32:07'),(262,3,1,'INVLSTRP',0,1,'2016-07-18 06:05:36',0,'2016-07-18 06:32:07'),(263,3,1,'IVSTCKCS',0,1,'2016-07-18 06:05:36',0,'2016-07-18 06:32:07'),(264,3,1,'LTL',0,1,'2016-07-18 06:05:36',0,'2016-07-18 06:32:07'),(265,3,1,'ICAA',0,1,'2016-07-18 06:05:36',0,'2016-07-18 06:32:07'),(266,3,1,'ItemDetR',0,1,'2016-07-18 06:05:36',0,'2016-07-18 06:32:07'),(267,3,1,'MSLM',0,1,'2016-07-18 06:05:36',0,'2016-07-18 06:32:07'),(268,3,1,'ITEMCAT',0,1,'2016-07-18 06:05:36',0,'2016-07-18 06:32:07'),(269,3,1,'ITEMTYP',0,1,'2016-07-18 06:05:36',0,'2016-07-18 06:32:07'),(270,3,1,'ITEMSET',0,1,'2016-07-18 06:05:36',0,'2016-07-18 06:32:07'),(271,3,1,'INVUM',0,1,'2016-07-18 06:05:36',0,'2016-07-18 06:32:07'),(272,3,1,'INEDITEM',0,1,'2016-07-18 06:05:37',0,'2016-07-18 06:32:07'),(273,3,1,'INNWITEM',0,1,'2016-07-18 06:05:37',0,'2016-07-18 06:32:07'),(274,3,1,'IVUNTMSR',0,1,'2016-07-18 06:05:37',0,'2016-07-18 06:32:07'),(275,3,1,'OPNBALIN',0,1,'2016-07-18 06:05:37',0,'2016-07-18 06:32:07'),(276,3,1,'SOQUOT',0,1,'2016-07-18 06:05:38',0,'2016-07-18 06:32:08'),(277,3,1,'SOTRNWSO',0,1,'2016-07-18 06:05:38',0,'2016-07-18 06:32:08'),(278,3,1,'SOTRDO',0,1,'2016-07-18 06:05:38',0,'2016-07-18 06:32:08'),(279,3,1,'DELCNFRM',0,1,'2016-07-18 06:05:38',0,'2016-07-18 06:32:08'),(280,3,1,'SOTRQOLT',0,1,'2016-07-18 06:05:38',0,'2016-07-18 06:32:08'),(281,3,1,'SORPPCLT',0,1,'2016-07-18 06:05:38',0,'2016-07-18 06:32:08'),(282,3,1,'SOTRDOLT',0,1,'2016-07-18 06:05:38',0,'2016-07-18 06:32:08'),(283,3,1,'SOTRSOLT',0,1,'2016-07-18 06:05:38',0,'2016-07-18 06:32:08'),(284,3,1,'SORPSOCU',0,1,'2016-07-18 06:05:38',0,'2016-07-18 06:32:08'),(285,3,1,'SORPYRSL',0,1,'2016-07-18 06:05:38',0,'2016-07-18 06:32:08'),(286,3,1,'SORPSLIT',0,1,'2016-07-18 06:05:38',0,'2016-07-18 06:32:08'),(287,3,1,'SORPORCT',0,1,'2016-07-18 06:05:38',0,'2016-07-18 06:32:08'),(288,3,1,'SORPSOIT',0,1,'2016-07-18 06:05:38',0,'2016-07-18 06:32:08'),(289,3,1,'SORPOROT',0,1,'2016-07-18 06:05:39',0,'2016-07-18 06:32:08'),(290,3,1,'SOSTSLPC',0,1,'2016-07-18 06:05:39',0,'2016-07-18 06:32:08'),(291,3,1,'TXTRPROC',0,1,'2016-07-18 06:05:39',0,'2016-07-18 06:32:09'),(292,3,1,'GSBADRLF',0,1,'2016-07-18 06:05:40',0,'2016-07-18 06:32:10'),(293,3,1,'BADBTRLC',0,1,'2016-07-18 06:05:40',0,'2016-07-18 06:32:10'),(294,3,1,'GSBADBTR',0,1,'2016-07-18 06:05:40',0,'2016-07-18 06:32:10'),(295,3,1,'BDEBRCCO',0,1,'2016-07-18 06:05:40',0,'2016-07-18 06:32:10'),(296,3,1,'GTSJNL',0,1,'2016-07-18 06:05:40',0,'2016-07-18 06:32:10'),(297,3,1,'GSTJCNF',0,1,'2016-07-18 06:05:40',0,'2016-07-18 06:32:10'),(298,3,1,'SUPBDRLF',0,1,'2016-07-18 06:05:40',0,'2016-07-18 06:32:10'),(299,3,1,'SPBDRLC',0,1,'2016-07-18 06:05:40',0,'2016-07-18 06:32:10'),(300,3,1,'SBDEBRCV',0,1,'2016-07-18 06:05:40',0,'2016-07-18 06:32:10'),(301,3,1,'SPBDRCNF',0,1,'2016-07-18 06:05:40',0,'2016-07-18 06:32:10'),(302,3,1,'GST03',0,1,'2016-07-18 06:05:40',0,'2016-07-18 06:32:10'),(303,3,1,'GSTRPT01',0,1,'2016-07-18 06:05:40',0,'2016-07-18 06:32:10'),(304,3,1,'BDRETRPT',0,1,'2016-07-18 06:05:40',0,'2016-07-18 06:32:10'),(305,3,1,'BDRCVRPT',0,1,'2016-07-18 06:05:40',0,'2016-07-18 06:32:10'),(306,3,1,'GSTRTSUM',0,1,'2016-07-18 06:05:40',0,'2016-07-18 06:32:10'),(307,3,1,'GST03SUM',0,1,'2016-07-18 06:05:40',0,'2016-07-18 06:32:10'),(308,3,1,'GSTMSTR',0,1,'2016-07-18 06:05:40',0,'2016-07-18 06:32:10'),(309,3,1,'GSTCLASS',0,1,'2016-07-18 06:05:40',0,'2016-07-18 06:32:10'),(310,3,1,'GSTGROUP',0,1,'2016-07-18 06:05:40',0,'2016-07-18 06:32:10'),(311,3,1,'GSTTYPE',0,1,'2016-07-18 06:05:40',0,'2016-07-18 06:32:10'),(312,3,1,'GSTTXMP',0,1,'2016-07-18 06:05:40',0,'2016-07-18 06:32:10'),(313,3,1,'GSTPREF',0,1,'2016-07-18 06:05:40',0,'2016-07-18 06:32:10'),(314,3,1,'GSTPREF',0,1,'2016-07-18 06:05:40',0,'2016-07-18 06:32:10'),(315,3,1,'ZKTTRCAL',0,1,'2016-07-18 06:05:42',0,'2016-07-18 06:32:12'),(316,3,1,'WKFCAL',0,1,'2016-07-18 06:05:42',0,'2016-07-18 06:32:12'),(317,3,1,'ZKTRGPLT',0,1,'2016-07-18 06:05:42',0,'2016-07-18 06:32:12'),(318,3,1,'ZKRPCTRL',0,1,'2016-07-18 06:05:42',0,'2016-07-18 06:32:12'),(319,3,1,'ZKRPNBLT',0,1,'2016-07-18 06:05:42',0,'2016-07-18 06:32:12'),(320,3,1,'ZKRPSMLT',0,1,'2016-07-18 06:05:42',0,'2016-07-18 06:32:12'),(321,3,1,'WKFLST',0,1,'2016-07-18 06:05:42',0,'2016-07-18 06:32:12'),(322,3,1,'ZKTSTGRP',0,1,'2016-07-18 06:05:42',0,'2016-07-18 06:32:12'),(323,3,1,'ZKTSTNSB',0,1,'2016-07-18 06:05:42',0,'2016-07-18 06:32:12'),(324,3,1,'ZKTSTNSD',0,1,'2016-07-18 06:05:42',0,'2016-07-18 06:32:12'),(325,3,1,'ZKSTCNTR',0,1,'2016-07-18 06:05:42',0,'2016-07-18 06:32:12'),(326,3,1,'WKSTMSTR',0,1,'2016-07-18 06:05:42',0,'2016-07-18 06:32:12'),(327,3,1,'WCQCNTR',0,1,'2016-07-18 06:05:42',0,'2016-07-18 06:32:12'),(328,3,1,'PURORDER',0,1,'2016-07-18 06:05:43',0,'2016-07-18 06:32:13'),(329,3,1,'PURRCV',0,1,'2016-07-18 06:05:43',0,'2016-07-18 06:32:13'),(330,3,1,'PURORDCF',0,1,'2016-07-18 06:05:43',0,'2016-07-18 06:32:13'),(331,3,1,'PURRCVC',0,1,'2016-07-18 06:05:43',0,'2016-07-18 06:32:13'),(332,3,1,'PURORLST',0,1,'2016-07-18 06:05:44',0,'2016-07-18 06:32:13'),(333,3,1,'PURRCVLS',0,1,'2016-07-18 06:05:44',0,'2016-07-18 06:32:13'),(334,3,1,'PUROUTGR',0,1,'2016-07-18 06:05:44',0,'2016-07-18 06:32:14'),(335,3,1,'PUPRRPT',0,1,'2016-07-18 06:05:44',0,'2016-07-18 06:32:14'),(336,3,1,'PURCNCL',0,1,'2016-07-18 06:05:44',0,'2016-07-18 06:32:14'),(337,3,1,'PURRCVCA',0,1,'2016-07-18 06:05:44',0,'2016-07-18 06:32:14'),(338,3,1,'PURSTSPL',0,1,'2016-07-18 06:05:44',0,'2016-07-18 06:32:14'),(339,3,1,'INVPURPR',0,1,'2016-07-18 06:05:44',0,'2016-07-18 06:32:14'),(340,3,1,'UMCONVNW',0,1,'2016-07-18 06:05:44',0,'2016-07-18 06:32:14'),(341,3,1,'PURUOMLS',0,1,'2016-07-18 06:05:44',0,'2016-07-18 06:32:14'),(342,3,1,'UM',0,1,'2016-07-18 06:05:45',0,'2016-07-18 06:32:15'),(343,3,1,'UML',0,1,'2016-07-18 06:05:45',0,'2016-07-18 06:32:15'),(344,3,1,'MUL',0,1,'2016-07-18 06:05:45',0,'2016-07-18 06:32:15'),(345,3,1,'LOGRPT',0,1,'2016-07-18 06:05:45',0,'2016-07-18 06:32:15'),(346,3,1,'UMACCSS',0,1,'2016-07-18 06:05:45',0,'2016-07-18 06:32:15'),(347,3,1,'ADMMENU',0,1,'2016-07-18 06:05:45',0,'2016-07-18 06:32:15'),(348,3,1,'USRADD',0,1,'2016-07-18 06:05:46',0,'2016-07-18 06:32:15'),(349,3,1,'BACKUP',0,1,'2016-07-18 06:05:46',0,'2016-07-18 06:32:15'),(350,3,1,'updversi',0,1,'2016-07-18 06:05:46',0,'2016-07-18 06:32:15'),(351,3,1,'upgraden',0,1,'2016-07-18 06:05:46',0,'2016-07-18 06:32:15'),(352,3,1,'MSTRCOMP',0,1,'2016-07-18 06:05:47',0,'2016-07-18 06:32:16'),(353,3,1,'PROJECT',0,1,'2016-07-18 06:05:47',0,'2016-07-18 06:32:16'),(354,3,1,'TERM',0,1,'2016-07-18 06:05:47',0,'2016-07-18 06:32:16'),(355,3,1,'MSMTRCD',0,1,'2016-07-18 06:05:47',0,'2016-07-18 06:32:16'),(356,3,1,'EMP',0,1,'2016-07-18 06:05:47',0,'2016-07-18 06:32:16'),(357,3,1,'AGENTSTP',0,1,'2016-07-18 06:05:47',0,'2016-07-18 06:32:16'),(358,3,1,'BNKSETUP',0,1,'2016-07-18 06:05:47',0,'2016-07-18 06:32:16'),(359,3,1,'ShipToST',0,1,'2016-07-18 06:05:47',0,'2016-07-18 06:32:16'),(360,3,1,'GRAPHSET',0,1,'2016-07-18 06:05:47',0,'2016-07-18 06:32:16'),(361,3,75,'GLTRJRNL',1,1,'2016-07-18 06:09:56',0,'2016-07-18 06:09:56'),(362,3,75,'GLTRJlCY',1,1,'2016-07-18 06:09:56',0,'2016-07-18 06:09:56'),(363,3,75,'GLTRJlRV',1,1,'2016-07-18 06:09:56',0,'2016-07-18 06:09:56'),(364,3,75,'GLTRPOST',1,1,'2016-07-18 06:09:56',0,'2016-07-18 06:09:56'),(365,3,75,'APOPWOI',1,1,'2016-07-18 06:09:56',0,'2016-07-18 06:09:56'),(366,3,75,'GLTRYECL',1,1,'2016-07-18 06:09:56',0,'2016-07-18 06:09:56'),(367,3,75,'OTRPAY',1,1,'2016-07-18 06:09:56',0,'2016-07-18 06:09:56'),(368,3,75,'OTHRCV',1,1,'2016-07-18 06:09:56',0,'2016-07-18 06:09:56'),(369,3,75,'OTRCVCON',1,1,'2016-07-18 06:09:56',0,'2016-07-18 06:09:56'),(370,3,75,'GLRPBS',1,1,'2016-07-18 06:09:56',0,'2016-07-18 06:09:56'),(371,3,75,'GLRPTB',1,1,'2016-07-18 06:09:56',0,'2016-07-18 06:09:56'),(372,3,75,'GLRPJLPS',1,1,'2016-07-18 06:09:56',0,'2016-07-18 06:09:56'),(373,3,75,'GLRPJLUP',1,1,'2016-07-18 06:09:56',0,'2016-07-18 06:09:56'),(374,3,75,'GLRPTBFC',1,1,'2016-07-18 06:09:56',0,'2016-07-18 06:09:56'),(375,3,75,'GLRPABSM',1,1,'2016-07-18 06:09:56',0,'2016-07-18 06:09:56'),(376,3,75,'GLRPPNLM',1,1,'2016-07-18 06:09:56',0,'2016-07-18 06:09:56'),(377,3,75,'APRPTOPW',1,1,'2016-07-18 06:09:57',0,'2016-07-18 06:09:57'),(378,3,75,'GLRPBGLT',1,1,'2016-07-18 06:09:57',0,'2016-07-18 06:09:57'),(379,3,75,'APBANKRE',1,1,'2016-07-18 06:09:57',0,'2016-07-18 06:09:57'),(380,3,75,'OTRCVLST',1,1,'2016-07-18 06:09:57',0,'2016-07-18 06:09:57'),(381,3,75,'GLBNKRCL',1,1,'2016-07-18 06:09:57',0,'2016-07-18 06:09:57'),(382,3,75,'TRSCSUMM',1,1,'2016-07-18 06:09:57',0,'2016-07-18 06:09:57'),(383,3,75,'GLMCAL',1,1,'2016-07-18 06:09:57',0,'2016-07-18 06:09:57'),(384,3,75,'GLMCALL',1,1,'2016-07-18 06:09:57',0,'2016-07-18 06:09:57'),(385,3,75,'GLSTCOA',1,1,'2016-07-18 06:09:57',0,'2016-07-18 06:09:57'),(386,3,75,'GLSTBDGT',1,1,'2016-07-18 06:09:57',0,'2016-07-18 06:09:57'),(387,3,75,'GLSTCURC',1,1,'2016-07-18 06:09:57',0,'2016-07-18 06:09:57'),(388,3,75,'GLOPNBAL',1,1,'2016-07-18 06:09:57',0,'2016-07-18 06:09:57'),(389,3,75,'GLUNPRES',1,1,'2016-07-18 06:09:57',0,'2016-07-18 06:09:57'),(390,3,75,'ARSALINV',1,1,'2016-07-18 06:09:59',0,'2016-07-18 06:09:59'),(391,3,75,'ARSDBN',1,1,'2016-07-18 06:09:59',0,'2016-07-18 06:09:59'),(392,3,75,'ARDBNC',1,1,'2016-07-18 06:09:59',0,'2016-07-18 06:09:59'),(393,3,75,'ARSCN',1,1,'2016-07-18 06:09:59',0,'2016-07-18 06:09:59'),(394,3,75,'ARSCNC',1,1,'2016-07-18 06:09:59',0,'2016-07-18 06:09:59'),(395,3,75,'ARRCVP',1,1,'2016-07-18 06:09:59',0,'2016-07-18 06:09:59'),(396,3,75,'ARRCVPC',1,1,'2016-07-18 06:09:59',0,'2016-07-18 06:09:59'),(397,3,75,'ARDSLINV',1,1,'2016-07-18 06:09:59',0,'2016-07-18 06:09:59'),(398,3,75,'ARDRSINV',1,1,'2016-07-18 06:09:59',0,'2016-07-18 06:09:59'),(399,3,75,'ARCPYSI',1,1,'2016-07-18 06:09:59',0,'2016-07-18 06:09:59'),(400,3,75,'ARTRINED',1,1,'2016-07-18 06:09:59',0,'2016-07-18 06:09:59'),(401,3,75,'AREDSLDR',1,1,'2016-07-18 06:09:59',0,'2016-07-18 06:09:59'),(402,3,75,'AREDCR',1,1,'2016-07-18 06:09:59',0,'2016-07-18 06:09:59'),(403,3,75,'ARPAYEDT',1,1,'2016-07-18 06:09:59',0,'2016-07-18 06:09:59'),(404,3,75,'ARCASH',1,1,'2016-07-18 06:09:59',0,'2016-07-18 06:09:59'),(405,3,75,'ARCASHSC',1,1,'2016-07-18 06:10:00',0,'2016-07-18 06:10:00'),(406,3,75,'ARINVLST',1,1,'2016-07-18 06:10:00',0,'2016-07-18 06:10:00'),(407,3,75,'ARDBNLST',1,1,'2016-07-18 06:10:00',0,'2016-07-18 06:10:00'),(408,3,75,'ARCDNLST',1,1,'2016-07-18 06:10:00',0,'2016-07-18 06:10:00'),(409,3,75,'ARRCVPLS',1,1,'2016-07-18 06:10:00',0,'2016-07-18 06:10:00'),(410,3,75,'ARCUSTST',1,1,'2016-07-18 06:10:00',0,'2016-07-18 06:10:00'),(411,3,75,'ARCUSTAG',1,1,'2016-07-18 06:10:00',0,'2016-07-18 06:10:00'),(412,3,75,'ARCSHS',1,1,'2016-07-18 06:10:00',0,'2016-07-18 06:10:00'),(413,3,75,'ARSETCUS',1,1,'2016-07-18 06:10:00',0,'2016-07-18 06:10:00'),(414,3,75,'ARNWCUST',1,1,'2016-07-18 06:10:00',0,'2016-07-18 06:10:00'),(415,3,75,'ARSHIP2L',1,1,'2016-07-18 06:10:00',0,'2016-07-18 06:10:00'),(416,3,75,'ARSHIP2N',1,1,'2016-07-18 06:10:00',0,'2016-07-18 06:10:00'),(417,3,75,'ARHISTCU',1,1,'2016-07-18 06:10:00',0,'2016-07-18 06:10:00'),(418,3,75,'APSUPPAY',1,1,'2016-07-18 06:10:02',0,'2016-07-18 06:10:02'),(419,3,75,'APPURDN',1,1,'2016-07-18 06:10:02',0,'2016-07-18 06:10:02'),(420,3,75,'APPURCN',1,1,'2016-07-18 06:10:02',0,'2016-07-18 06:10:02'),(421,3,75,'APPURDNC',1,1,'2016-07-18 06:10:02',0,'2016-07-18 06:10:02'),(422,3,75,'APPURCNC',1,1,'2016-07-18 06:10:02',0,'2016-07-18 06:10:02'),(423,3,75,'APPAYCFM',1,1,'2016-07-18 06:10:02',0,'2016-07-18 06:10:02'),(424,3,75,'APOPWI',1,1,'2016-07-18 06:10:02',0,'2016-07-18 06:10:02'),(425,3,75,'APPAYICM',1,1,'2016-07-18 06:10:02',0,'2016-07-18 06:10:02'),(426,3,75,'APPURINV',1,1,'2016-07-18 06:10:02',0,'2016-07-18 06:10:02'),(427,3,75,'APDIRINV',1,1,'2016-07-18 06:10:02',0,'2016-07-18 06:10:02'),(428,3,75,'APDRINVC',1,1,'2016-07-18 06:10:02',0,'2016-07-18 06:10:02'),(429,3,75,'APCPYPI',1,1,'2016-07-18 06:10:02',0,'2016-07-18 06:10:02'),(430,3,75,'APDRNOTE',1,1,'2016-07-18 06:10:02',0,'2016-07-18 06:10:02'),(431,3,75,'APTRETCR',1,1,'2016-07-18 06:10:02',0,'2016-07-18 06:10:02'),(432,3,75,'APTRPYIE',1,1,'2016-07-18 06:10:02',0,'2016-07-18 06:10:02'),(433,3,75,'APTRPYOE',1,1,'2016-07-18 06:10:02',0,'2016-07-18 06:10:02'),(434,3,75,'APPURDNL',1,1,'2016-07-18 06:10:02',0,'2016-07-18 06:10:02'),(435,3,75,'APPURCNL',1,1,'2016-07-18 06:10:02',0,'2016-07-18 06:10:02'),(436,3,75,'APRPTSTL',1,1,'2016-07-18 06:10:02',0,'2016-07-18 06:10:02'),(437,3,75,'MSTRSUPP',1,1,'2016-07-18 06:10:03',0,'2016-07-18 06:10:03'),(438,3,75,'APNEWSUP',1,1,'2016-07-18 06:10:03',0,'2016-07-18 06:10:03'),(439,3,75,'APNWSHP2',1,1,'2016-07-18 06:10:03',0,'2016-07-18 06:10:03'),(440,3,75,'APHISTSU',1,1,'2016-07-18 06:10:03',0,'2016-07-18 06:10:03'),(441,3,75,'INVLOCTR',1,1,'2016-07-18 06:10:04',0,'2016-07-18 06:10:04'),(442,3,75,'INVITEMC',1,1,'2016-07-18 06:10:04',0,'2016-07-18 06:10:04'),(443,3,75,'INVLOCTC',1,1,'2016-07-18 06:10:04',0,'2016-07-18 06:10:04'),(444,3,75,'INVITCC',1,1,'2016-07-18 06:10:04',0,'2016-07-18 06:10:04'),(445,3,75,'INVPLNRP',1,1,'2016-07-18 06:10:04',0,'2016-07-18 06:10:04'),(446,3,75,'INVVALRP',1,1,'2016-07-18 06:10:04',0,'2016-07-18 06:10:04'),(447,3,75,'INVSTORP',1,1,'2016-07-18 06:10:04',0,'2016-07-18 06:10:04'),(448,3,75,'INVOUTRP',1,1,'2016-07-18 06:10:04',0,'2016-07-18 06:10:04'),(449,3,75,'INVMOVRP',1,1,'2016-07-18 06:10:04',0,'2016-07-18 06:10:04'),(450,3,75,'INVLSTRP',1,1,'2016-07-18 06:10:04',0,'2016-07-18 06:10:04'),(451,3,75,'IVSTCKCS',1,1,'2016-07-18 06:10:04',0,'2016-07-18 06:10:04'),(452,3,75,'LTL',1,1,'2016-07-18 06:10:04',0,'2016-07-18 06:10:04'),(453,3,75,'ICAA',1,1,'2016-07-18 06:10:05',0,'2016-07-18 06:10:05'),(454,3,75,'ItemDetR',1,1,'2016-07-18 06:10:05',0,'2016-07-18 06:10:05'),(455,3,75,'MSLM',1,1,'2016-07-18 06:10:05',0,'2016-07-18 06:10:05'),(456,3,75,'ITEMCAT',1,1,'2016-07-18 06:10:05',0,'2016-07-18 06:10:05'),(457,3,75,'ITEMTYP',1,1,'2016-07-18 06:10:05',0,'2016-07-18 06:10:05'),(458,3,75,'ITEMSET',1,1,'2016-07-18 06:10:05',0,'2016-07-18 06:10:05'),(459,3,75,'INVUM',1,1,'2016-07-18 06:10:05',0,'2016-07-18 06:10:05'),(460,3,75,'INEDITEM',1,1,'2016-07-18 06:10:05',0,'2016-07-18 06:10:05'),(461,3,75,'INNWITEM',1,1,'2016-07-18 06:10:05',0,'2016-07-18 06:10:05'),(462,3,75,'IVUNTMSR',1,1,'2016-07-18 06:10:05',0,'2016-07-18 06:10:05'),(463,3,75,'OPNBALIN',1,1,'2016-07-18 06:10:05',0,'2016-07-18 06:10:05'),(464,3,75,'SOQUOT',1,1,'2016-07-18 06:10:06',0,'2016-07-18 06:10:06'),(465,3,75,'SOTRNWSO',1,1,'2016-07-18 06:10:06',0,'2016-07-18 06:10:06'),(466,3,75,'SOTRDO',1,1,'2016-07-18 06:10:06',0,'2016-07-18 06:10:06'),(467,3,75,'DELCNFRM',1,1,'2016-07-18 06:10:06',0,'2016-07-18 06:10:06'),(468,3,75,'SOTRQOLT',1,1,'2016-07-18 06:10:06',0,'2016-07-18 06:10:06'),(469,3,75,'SORPPCLT',1,1,'2016-07-18 06:10:07',0,'2016-07-18 06:10:07'),(470,3,75,'SOTRDOLT',1,1,'2016-07-18 06:10:07',0,'2016-07-18 06:10:07'),(471,3,75,'SOTRSOLT',1,1,'2016-07-18 06:10:07',0,'2016-07-18 06:10:07'),(472,3,75,'SORPSOCU',1,1,'2016-07-18 06:10:07',0,'2016-07-18 06:10:07'),(473,3,75,'SORPYRSL',1,1,'2016-07-18 06:10:07',0,'2016-07-18 06:10:07'),(474,3,75,'SORPSLIT',1,1,'2016-07-18 06:10:07',0,'2016-07-18 06:10:07'),(475,3,75,'SORPORCT',1,1,'2016-07-18 06:10:07',0,'2016-07-18 06:10:07'),(476,3,75,'SORPSOIT',1,1,'2016-07-18 06:10:07',0,'2016-07-18 06:10:07'),(477,3,75,'SORPOROT',1,1,'2016-07-18 06:10:07',0,'2016-07-18 06:10:07'),(478,3,75,'SOSTSLPC',1,1,'2016-07-18 06:10:07',0,'2016-07-18 06:10:07'),(479,3,75,'TXTRPROC',1,1,'2016-07-18 06:10:08',0,'2016-07-18 06:10:08'),(480,3,75,'GSBADRLF',1,1,'2016-07-18 06:10:08',0,'2016-07-18 06:10:08'),(481,3,75,'BADBTRLC',1,1,'2016-07-18 06:10:08',0,'2016-07-18 06:10:08'),(482,3,75,'GSBADBTR',1,1,'2016-07-18 06:10:08',0,'2016-07-18 06:10:08'),(483,3,75,'BDEBRCCO',1,1,'2016-07-18 06:10:08',0,'2016-07-18 06:10:08'),(484,3,75,'GTSJNL',1,1,'2016-07-18 06:10:08',0,'2016-07-18 06:10:08'),(485,3,75,'GSTJCNF',1,1,'2016-07-18 06:10:08',0,'2016-07-18 06:10:08'),(486,3,75,'SUPBDRLF',1,1,'2016-07-18 06:10:08',0,'2016-07-18 06:10:08'),(487,3,75,'SPBDRLC',1,1,'2016-07-18 06:10:08',0,'2016-07-18 06:10:08'),(488,3,75,'SBDEBRCV',1,1,'2016-07-18 06:10:08',0,'2016-07-18 06:10:08'),(489,3,75,'SPBDRCNF',1,1,'2016-07-18 06:10:08',0,'2016-07-18 06:10:08'),(490,3,75,'GST03',1,1,'2016-07-18 06:10:08',0,'2016-07-18 06:10:08'),(491,3,75,'GSTRPT01',1,1,'2016-07-18 06:10:08',0,'2016-07-18 06:10:08'),(492,3,75,'BDRETRPT',1,1,'2016-07-18 06:10:08',0,'2016-07-18 06:10:08'),(493,3,75,'BDRCVRPT',1,1,'2016-07-18 06:10:08',0,'2016-07-18 06:10:08'),(494,3,75,'GSTRTSUM',1,1,'2016-07-18 06:10:08',0,'2016-07-18 06:10:08'),(495,3,75,'GST03SUM',1,1,'2016-07-18 06:10:08',0,'2016-07-18 06:10:08'),(496,3,75,'GSTMSTR',1,1,'2016-07-18 06:10:08',0,'2016-07-18 06:10:08'),(497,3,75,'GSTCLASS',1,1,'2016-07-18 06:10:08',0,'2016-07-18 06:10:08'),(498,3,75,'GSTGROUP',1,1,'2016-07-18 06:10:08',0,'2016-07-18 06:10:08'),(499,3,75,'GSTTYPE',1,1,'2016-07-18 06:10:08',0,'2016-07-18 06:10:08'),(500,3,75,'GSTTXMP',1,1,'2016-07-18 06:10:08',0,'2016-07-18 06:10:08'),(501,3,75,'GSTPREF',1,1,'2016-07-18 06:10:08',0,'2016-07-18 06:10:08'),(502,3,75,'GSTPREF',1,1,'2016-07-18 06:10:08',0,'2016-07-18 06:10:08'),(503,3,75,'ZKTTRCAL',1,1,'2016-07-18 06:10:09',0,'2016-07-18 06:10:09'),(504,3,75,'WKFCAL',1,1,'2016-07-18 06:10:09',0,'2016-07-18 06:10:09'),(505,3,75,'ZKTRGPLT',1,1,'2016-07-18 06:10:09',0,'2016-07-18 06:10:09'),(506,3,75,'ZKRPCTRL',1,1,'2016-07-18 06:10:09',0,'2016-07-18 06:10:09'),(507,3,75,'ZKRPNBLT',1,1,'2016-07-18 06:10:10',0,'2016-07-18 06:10:10'),(508,3,75,'ZKRPSMLT',1,1,'2016-07-18 06:10:10',0,'2016-07-18 06:10:10'),(509,3,75,'WKFLST',1,1,'2016-07-18 06:10:10',0,'2016-07-18 06:10:10'),(510,3,75,'ZKTSTGRP',1,1,'2016-07-18 06:10:10',0,'2016-07-18 06:10:10'),(511,3,75,'ZKTSTNSB',1,1,'2016-07-18 06:10:10',0,'2016-07-18 06:10:10'),(512,3,75,'ZKTSTNSD',1,1,'2016-07-18 06:10:10',0,'2016-07-18 06:10:10'),(513,3,75,'ZKSTCNTR',1,1,'2016-07-18 06:10:10',0,'2016-07-18 06:10:10'),(514,3,75,'WKSTMSTR',1,1,'2016-07-18 06:10:10',0,'2016-07-18 06:10:10'),(515,3,75,'WCQCNTR',1,1,'2016-07-18 06:10:10',0,'2016-07-18 06:10:10'),(516,3,75,'PURORDER',1,1,'2016-07-18 06:10:10',0,'2016-07-18 06:10:10'),(517,3,75,'PURRCV',1,1,'2016-07-18 06:10:10',0,'2016-07-18 06:10:10'),(518,3,75,'PURORDCF',1,1,'2016-07-18 06:10:10',0,'2016-07-18 06:10:10'),(519,3,75,'PURRCVC',1,1,'2016-07-18 06:10:10',0,'2016-07-18 06:10:10'),(520,3,75,'PURORLST',1,1,'2016-07-18 06:10:10',0,'2016-07-18 06:10:10'),(521,3,75,'PURRCVLS',1,1,'2016-07-18 06:10:10',0,'2016-07-18 06:10:10'),(522,3,75,'PUROUTGR',1,1,'2016-07-18 06:10:11',0,'2016-07-18 06:10:11'),(523,3,75,'PUPRRPT',1,1,'2016-07-18 06:10:11',0,'2016-07-18 06:10:11'),(524,3,75,'PURCNCL',1,1,'2016-07-18 06:10:11',0,'2016-07-18 06:10:11'),(525,3,75,'PURRCVCA',1,1,'2016-07-18 06:10:11',0,'2016-07-18 06:10:11'),(526,3,75,'PURSTSPL',1,1,'2016-07-18 06:10:11',0,'2016-07-18 06:10:11'),(527,3,75,'INVPURPR',1,1,'2016-07-18 06:10:11',0,'2016-07-18 06:10:11'),(528,3,75,'UMCONVNW',1,1,'2016-07-18 06:10:11',0,'2016-07-18 06:10:11'),(529,3,75,'PURUOMLS',1,1,'2016-07-18 06:10:11',0,'2016-07-18 06:10:11'),(530,3,75,'UM',1,1,'2016-07-18 06:10:11',0,'2016-07-18 06:10:11'),(531,3,75,'UML',1,1,'2016-07-18 06:10:11',0,'2016-07-18 06:10:11'),(532,3,75,'MUL',1,1,'2016-07-18 06:10:11',0,'2016-07-18 06:10:11'),(533,3,75,'LOGRPT',1,1,'2016-07-18 06:10:11',0,'2016-07-18 06:10:11'),(534,3,75,'UMACCSS',1,1,'2016-07-18 06:10:11',0,'2016-07-18 06:10:11'),(535,3,75,'ADMMENU',1,1,'2016-07-18 06:10:11',0,'2016-07-18 06:10:11'),(536,3,75,'USRADD',1,1,'2016-07-18 06:10:11',0,'2016-07-18 06:10:11'),(537,3,75,'BACKUP',1,1,'2016-07-18 06:10:11',0,'2016-07-18 06:10:11'),(538,3,75,'updversi',1,1,'2016-07-18 06:10:12',0,'2016-07-18 06:10:12'),(539,3,75,'upgraden',1,1,'2016-07-18 06:10:12',0,'2016-07-18 06:10:12'),(540,3,75,'MSTRCOMP',1,1,'2016-07-18 06:10:12',0,'2016-07-18 06:10:12'),(541,3,75,'PROJECT',1,1,'2016-07-18 06:10:12',0,'2016-07-18 06:10:12'),(542,3,75,'TERM',1,1,'2016-07-18 06:10:12',0,'2016-07-18 06:10:12'),(543,3,75,'MSMTRCD',1,1,'2016-07-18 06:10:12',0,'2016-07-18 06:10:12'),(544,3,75,'EMP',1,1,'2016-07-18 06:10:12',0,'2016-07-18 06:10:12'),(545,3,75,'AGENTSTP',1,1,'2016-07-18 06:10:12',0,'2016-07-18 06:10:12'),(546,3,75,'BNKSETUP',1,1,'2016-07-18 06:10:12',0,'2016-07-18 06:10:12'),(547,3,75,'ShipToST',1,1,'2016-07-18 06:10:12',0,'2016-07-18 06:10:12'),(548,3,75,'GRAPHSET',1,1,'2016-07-18 06:10:12',0,'2016-07-18 06:10:12'),(549,3,76,'GLTRJRNL',1,75,'2016-07-18 08:29:11',0,'2016-07-18 08:29:11'),(550,3,76,'GLTRJlCY',1,75,'2016-07-18 08:29:11',0,'2016-07-18 08:29:11'),(551,3,76,'GLTRJlRV',1,75,'2016-07-18 08:29:11',0,'2016-07-18 08:29:11'),(552,3,76,'GLTRPOST',1,75,'2016-07-18 08:29:11',0,'2016-07-18 08:29:11'),(553,3,76,'APOPWOI',1,75,'2016-07-18 08:29:11',0,'2016-07-18 08:29:11'),(554,3,76,'GLTRYECL',1,75,'2016-07-18 08:29:11',0,'2016-07-18 08:29:11'),(555,3,76,'OTRPAY',1,75,'2016-07-18 08:29:11',0,'2016-07-18 08:29:11'),(556,3,76,'OTHRCV',1,75,'2016-07-18 08:29:11',0,'2016-07-18 08:29:11'),(557,3,76,'OTRCVCON',1,75,'2016-07-18 08:29:11',0,'2016-07-18 08:29:11'),(558,3,76,'GLRPBS',1,75,'2016-07-18 08:29:11',0,'2016-07-18 08:29:11'),(559,3,76,'GLRPTB',1,75,'2016-07-18 08:29:11',0,'2016-07-18 08:29:11'),(560,3,76,'GLRPJLPS',1,75,'2016-07-18 08:29:11',0,'2016-07-18 08:29:11'),(561,3,76,'GLRPJLUP',1,75,'2016-07-18 08:29:11',0,'2016-07-18 08:29:11'),(562,3,76,'GLRPTBFC',1,75,'2016-07-18 08:29:11',0,'2016-07-18 08:29:11'),(563,3,76,'GLRPABSM',1,75,'2016-07-18 08:29:11',0,'2016-07-18 08:29:11'),(564,3,76,'GLRPPNLM',1,75,'2016-07-18 08:29:11',0,'2016-07-18 08:29:11'),(565,3,76,'APRPTOPW',1,75,'2016-07-18 08:29:11',0,'2016-07-18 08:29:11'),(566,3,76,'GLRPBGLT',1,75,'2016-07-18 08:29:11',0,'2016-07-18 08:29:11'),(567,3,76,'APBANKRE',1,75,'2016-07-18 08:29:11',0,'2016-07-18 08:29:11'),(568,3,76,'OTRCVLST',1,75,'2016-07-18 08:29:11',0,'2016-07-18 08:29:11'),(569,3,76,'GLBNKRCL',1,75,'2016-07-18 08:29:11',0,'2016-07-18 08:29:11'),(570,3,76,'TRSCSUMM',1,75,'2016-07-18 08:29:11',0,'2016-07-18 08:29:11'),(571,3,76,'GLMCAL',1,75,'2016-07-18 08:29:11',0,'2016-07-18 08:29:11'),(572,3,76,'GLMCALL',1,75,'2016-07-18 08:29:11',0,'2016-07-18 08:29:11'),(573,3,76,'GLSTCOA',1,75,'2016-07-18 08:29:12',0,'2016-07-18 08:29:12'),(574,3,76,'GLSTBDGT',1,75,'2016-07-18 08:29:12',0,'2016-07-18 08:29:12'),(575,3,76,'GLSTCURC',1,75,'2016-07-18 08:29:12',0,'2016-07-18 08:29:12'),(576,3,76,'GLOPNBAL',1,75,'2016-07-18 08:29:12',0,'2016-07-18 08:29:12'),(577,3,76,'GLUNPRES',1,75,'2016-07-18 08:29:12',0,'2016-07-18 08:29:12'),(578,3,76,'ARSALINV',1,75,'2016-07-18 08:29:13',0,'2016-07-18 08:29:13'),(579,3,76,'ARSDBN',1,75,'2016-07-18 08:29:13',0,'2016-07-18 08:29:13'),(580,3,76,'ARDBNC',1,75,'2016-07-18 08:29:13',0,'2016-07-18 08:29:13'),(581,3,76,'ARSCN',1,75,'2016-07-18 08:29:13',0,'2016-07-18 08:29:13'),(582,3,76,'ARSCNC',1,75,'2016-07-18 08:29:13',0,'2016-07-18 08:29:13'),(583,3,76,'ARRCVP',1,75,'2016-07-18 08:29:13',0,'2016-07-18 08:29:13'),(584,3,76,'ARRCVPC',1,75,'2016-07-18 08:29:13',0,'2016-07-18 08:29:13'),(585,3,76,'ARDSLINV',1,75,'2016-07-18 08:29:13',0,'2016-07-18 08:29:13'),(586,3,76,'ARDRSINV',1,75,'2016-07-18 08:29:13',0,'2016-07-18 08:29:13'),(587,3,76,'ARCPYSI',1,75,'2016-07-18 08:29:13',0,'2016-07-18 08:29:13'),(588,3,76,'ARTRINED',1,75,'2016-07-18 08:29:13',0,'2016-07-18 08:29:13'),(589,3,76,'AREDSLDR',1,75,'2016-07-18 08:29:14',0,'2016-07-18 08:29:14'),(590,3,76,'AREDCR',1,75,'2016-07-18 08:29:14',0,'2016-07-18 08:29:14'),(591,3,76,'ARPAYEDT',1,75,'2016-07-18 08:29:14',0,'2016-07-18 08:29:14'),(592,3,76,'ARCASH',1,75,'2016-07-18 08:29:14',0,'2016-07-18 08:29:14'),(593,3,76,'ARCASHSC',1,75,'2016-07-18 08:29:14',0,'2016-07-18 08:29:14'),(594,3,76,'ARINVLST',1,75,'2016-07-18 08:29:14',0,'2016-07-18 08:29:14'),(595,3,76,'ARDBNLST',1,75,'2016-07-18 08:29:14',0,'2016-07-18 08:29:14'),(596,3,76,'ARCDNLST',1,75,'2016-07-18 08:29:14',0,'2016-07-18 08:29:14'),(597,3,76,'ARRCVPLS',1,75,'2016-07-18 08:29:14',0,'2016-07-18 08:29:14'),(598,3,76,'ARCUSTST',1,75,'2016-07-18 08:29:14',0,'2016-07-18 08:29:14'),(599,3,76,'ARCUSTAG',1,75,'2016-07-18 08:29:14',0,'2016-07-18 08:29:14'),(600,3,76,'ARCSHS',1,75,'2016-07-18 08:29:14',0,'2016-07-18 08:29:14'),(601,3,76,'ARSETCUS',1,75,'2016-07-18 08:29:14',0,'2016-07-18 08:29:14'),(602,3,76,'ARNWCUST',1,75,'2016-07-18 08:29:14',0,'2016-07-18 08:29:14'),(603,3,76,'ARSHIP2L',1,75,'2016-07-18 08:29:14',0,'2016-07-18 08:29:14'),(604,3,76,'ARSHIP2N',1,75,'2016-07-18 08:29:14',0,'2016-07-18 08:29:14'),(605,3,76,'ARHISTCU',1,75,'2016-07-18 08:29:14',0,'2016-07-18 08:29:14'),(606,3,76,'APSUPPAY',1,75,'2016-07-18 08:29:15',0,'2016-07-18 08:29:15'),(607,3,76,'APPURDN',1,75,'2016-07-18 08:29:15',0,'2016-07-18 08:29:15'),(608,3,76,'APPURCN',1,75,'2016-07-18 08:29:15',0,'2016-07-18 08:29:15'),(609,3,76,'APPURDNC',1,75,'2016-07-18 08:29:15',0,'2016-07-18 08:29:15'),(610,3,76,'APPURCNC',1,75,'2016-07-18 08:29:15',0,'2016-07-18 08:29:15'),(611,3,76,'APPAYCFM',1,75,'2016-07-18 08:29:15',0,'2016-07-18 08:29:15'),(612,3,76,'APOPWI',1,75,'2016-07-18 08:29:15',0,'2016-07-18 08:29:15'),(613,3,76,'APPAYICM',1,75,'2016-07-18 08:29:15',0,'2016-07-18 08:29:15'),(614,3,76,'APPURINV',1,75,'2016-07-18 08:29:15',0,'2016-07-18 08:29:15'),(615,3,76,'APDIRINV',1,75,'2016-07-18 08:29:15',0,'2016-07-18 08:29:15'),(616,3,76,'APDRINVC',1,75,'2016-07-18 08:29:15',0,'2016-07-18 08:29:15'),(617,3,76,'APCPYPI',1,75,'2016-07-18 08:29:15',0,'2016-07-18 08:29:15'),(618,3,76,'APDRNOTE',1,75,'2016-07-18 08:29:15',0,'2016-07-18 08:29:15'),(619,3,76,'APTRETCR',1,75,'2016-07-18 08:29:15',0,'2016-07-18 08:29:15'),(620,3,76,'APTRPYIE',1,75,'2016-07-18 08:29:15',0,'2016-07-18 08:29:15'),(621,3,76,'APTRPYOE',1,75,'2016-07-18 08:29:16',0,'2016-07-18 08:29:16'),(622,3,76,'APPURDNL',1,75,'2016-07-18 08:29:16',0,'2016-07-18 08:29:16'),(623,3,76,'APPURCNL',1,75,'2016-07-18 08:29:16',0,'2016-07-18 08:29:16'),(624,3,76,'APRPTSTL',1,75,'2016-07-18 08:29:16',0,'2016-07-18 08:29:16'),(625,3,76,'MSTRSUPP',1,75,'2016-07-18 08:29:16',0,'2016-07-18 08:29:16'),(626,3,76,'APNEWSUP',1,75,'2016-07-18 08:29:16',0,'2016-07-18 08:29:16'),(627,3,76,'APNWSHP2',1,75,'2016-07-18 08:29:16',0,'2016-07-18 08:29:16'),(628,3,76,'APHISTSU',1,75,'2016-07-18 08:29:16',0,'2016-07-18 08:29:16'),(629,3,76,'INVLOCTR',1,75,'2016-07-18 08:29:17',0,'2016-07-18 08:29:17'),(630,3,76,'INVITEMC',1,75,'2016-07-18 08:29:17',0,'2016-07-18 08:29:17'),(631,3,76,'INVLOCTC',1,75,'2016-07-18 08:29:17',0,'2016-07-18 08:29:17'),(632,3,76,'INVITCC',1,75,'2016-07-18 08:29:17',0,'2016-07-18 08:29:17'),(633,3,76,'INVPLNRP',1,75,'2016-07-18 08:29:17',0,'2016-07-18 08:29:17'),(634,3,76,'INVVALRP',1,75,'2016-07-18 08:29:17',0,'2016-07-18 08:29:17'),(635,3,76,'INVSTORP',1,75,'2016-07-18 08:29:17',0,'2016-07-18 08:29:17'),(636,3,76,'INVOUTRP',1,75,'2016-07-18 08:29:17',0,'2016-07-18 08:29:17'),(637,3,76,'INVMOVRP',1,75,'2016-07-18 08:29:17',0,'2016-07-18 08:29:17'),(638,3,76,'INVLSTRP',1,75,'2016-07-18 08:29:17',0,'2016-07-18 08:29:17'),(639,3,76,'IVSTCKCS',1,75,'2016-07-18 08:29:17',0,'2016-07-18 08:29:17'),(640,3,76,'LTL',1,75,'2016-07-18 08:29:17',0,'2016-07-18 08:29:17'),(641,3,76,'ICAA',1,75,'2016-07-18 08:29:17',0,'2016-07-18 08:29:17'),(642,3,76,'ItemDetR',1,75,'2016-07-18 08:29:17',0,'2016-07-18 08:29:17'),(643,3,76,'MSLM',1,75,'2016-07-18 08:29:17',0,'2016-07-18 08:29:17'),(644,3,76,'ITEMCAT',1,75,'2016-07-18 08:29:17',0,'2016-07-18 08:29:17'),(645,3,76,'ITEMTYP',1,75,'2016-07-18 08:29:17',0,'2016-07-18 08:29:17'),(646,3,76,'ITEMSET',1,75,'2016-07-18 08:29:17',0,'2016-07-18 08:29:17'),(647,3,76,'INVUM',1,75,'2016-07-18 08:29:17',0,'2016-07-18 08:29:17'),(648,3,76,'INEDITEM',1,75,'2016-07-18 08:29:17',0,'2016-07-18 08:29:17'),(649,3,76,'INNWITEM',1,75,'2016-07-18 08:29:17',0,'2016-07-18 08:29:17'),(650,3,76,'IVUNTMSR',1,75,'2016-07-18 08:29:17',0,'2016-07-18 08:29:17'),(651,3,76,'OPNBALIN',1,75,'2016-07-18 08:29:17',0,'2016-07-18 08:29:17'),(652,3,76,'SOQUOT',1,75,'2016-07-18 08:29:18',0,'2016-07-18 08:29:18'),(653,3,76,'SOTRNWSO',1,75,'2016-07-18 08:29:18',0,'2016-07-18 08:29:18'),(654,3,76,'SOTRDO',1,75,'2016-07-18 08:29:18',0,'2016-07-18 08:29:18'),(655,3,76,'DELCNFRM',1,75,'2016-07-18 08:29:18',0,'2016-07-18 08:29:18'),(656,3,76,'SOTRQOLT',1,75,'2016-07-18 08:29:18',0,'2016-07-18 08:29:18'),(657,3,76,'SORPPCLT',1,75,'2016-07-18 08:29:18',0,'2016-07-18 08:29:18'),(658,3,76,'SOTRDOLT',1,75,'2016-07-18 08:29:18',0,'2016-07-18 08:29:18'),(659,3,76,'SOTRSOLT',1,75,'2016-07-18 08:29:18',0,'2016-07-18 08:29:18'),(660,3,76,'SORPSOCU',1,75,'2016-07-18 08:29:18',0,'2016-07-18 08:29:18'),(661,3,76,'SORPYRSL',1,75,'2016-07-18 08:29:18',0,'2016-07-18 08:29:18'),(662,3,76,'SORPSLIT',1,75,'2016-07-18 08:29:18',0,'2016-07-18 08:29:18'),(663,3,76,'SORPORCT',1,75,'2016-07-18 08:29:18',0,'2016-07-18 08:29:18'),(664,3,76,'SORPSOIT',1,75,'2016-07-18 08:29:19',0,'2016-07-18 08:29:19'),(665,3,76,'SORPOROT',1,75,'2016-07-18 08:29:19',0,'2016-07-18 08:29:19'),(666,3,76,'SOSTSLPC',1,75,'2016-07-18 08:29:19',0,'2016-07-18 08:29:19'),(667,3,76,'TXTRPROC',1,75,'2016-07-18 08:29:19',0,'2016-07-18 08:29:19'),(668,3,76,'GSBADRLF',1,75,'2016-07-18 08:29:19',0,'2016-07-18 08:29:19'),(669,3,76,'BADBTRLC',1,75,'2016-07-18 08:29:19',0,'2016-07-18 08:29:19'),(670,3,76,'GSBADBTR',1,75,'2016-07-18 08:29:19',0,'2016-07-18 08:29:19'),(671,3,76,'BDEBRCCO',1,75,'2016-07-18 08:29:19',0,'2016-07-18 08:29:19'),(672,3,76,'GTSJNL',1,75,'2016-07-18 08:29:19',0,'2016-07-18 08:29:19'),(673,3,76,'GSTJCNF',1,75,'2016-07-18 08:29:19',0,'2016-07-18 08:29:19'),(674,3,76,'SUPBDRLF',1,75,'2016-07-18 08:29:19',0,'2016-07-18 08:29:19'),(675,3,76,'SPBDRLC',1,75,'2016-07-18 08:29:20',0,'2016-07-18 08:29:20'),(676,3,76,'SBDEBRCV',1,75,'2016-07-18 08:29:20',0,'2016-07-18 08:29:20'),(677,3,76,'SPBDRCNF',1,75,'2016-07-18 08:29:20',0,'2016-07-18 08:29:20'),(678,3,76,'GST03',1,75,'2016-07-18 08:29:20',0,'2016-07-18 08:29:20'),(679,3,76,'GSTRPT01',1,75,'2016-07-18 08:29:20',0,'2016-07-18 08:29:20'),(680,3,76,'BDRETRPT',1,75,'2016-07-18 08:29:20',0,'2016-07-18 08:29:20'),(681,3,76,'BDRCVRPT',1,75,'2016-07-18 08:29:20',0,'2016-07-18 08:29:20'),(682,3,76,'GSTRTSUM',1,75,'2016-07-18 08:29:20',0,'2016-07-18 08:29:20'),(683,3,76,'GST03SUM',1,75,'2016-07-18 08:29:20',0,'2016-07-18 08:29:20'),(684,3,76,'GSTMSTR',1,75,'2016-07-18 08:29:20',0,'2016-07-18 08:29:20'),(685,3,76,'GSTCLASS',1,75,'2016-07-18 08:29:20',0,'2016-07-18 08:29:20'),(686,3,76,'GSTGROUP',1,75,'2016-07-18 08:29:20',0,'2016-07-18 08:29:20'),(687,3,76,'GSTTYPE',1,75,'2016-07-18 08:29:20',0,'2016-07-18 08:29:20'),(688,3,76,'GSTTXMP',1,75,'2016-07-18 08:29:20',0,'2016-07-18 08:29:20'),(689,3,76,'GSTPREF',1,75,'2016-07-18 08:29:20',0,'2016-07-18 08:29:20'),(690,3,76,'GSTPREF',1,75,'2016-07-18 08:29:20',0,'2016-07-18 08:29:20'),(691,3,76,'ZKTTRCAL',1,75,'2016-07-18 08:29:21',0,'2016-07-18 08:29:21'),(692,3,76,'WKFCAL',1,75,'2016-07-18 08:29:21',0,'2016-07-18 08:29:21'),(693,3,76,'ZKTRGPLT',1,75,'2016-07-18 08:29:21',0,'2016-07-18 08:29:21'),(694,3,76,'ZKRPCTRL',1,75,'2016-07-18 08:29:21',0,'2016-07-18 08:29:21'),(695,3,76,'ZKRPNBLT',1,75,'2016-07-18 08:29:21',0,'2016-07-18 08:29:21'),(696,3,76,'ZKRPSMLT',1,75,'2016-07-18 08:29:21',0,'2016-07-18 08:29:21'),(697,3,76,'WKFLST',1,75,'2016-07-18 08:29:21',0,'2016-07-18 08:29:21'),(698,3,76,'ZKTSTGRP',1,75,'2016-07-18 08:29:21',0,'2016-07-18 08:29:21'),(699,3,76,'ZKTSTNSB',1,75,'2016-07-18 08:29:21',0,'2016-07-18 08:29:21'),(700,3,76,'ZKTSTNSD',1,75,'2016-07-18 08:29:21',0,'2016-07-18 08:29:21'),(701,3,76,'ZKSTCNTR',1,75,'2016-07-18 08:29:21',0,'2016-07-18 08:29:21'),(702,3,76,'WKSTMSTR',1,75,'2016-07-18 08:29:21',0,'2016-07-18 08:29:21'),(703,3,76,'WCQCNTR',1,75,'2016-07-18 08:29:21',0,'2016-07-18 08:29:21'),(704,3,76,'PURORDER',1,75,'2016-07-18 08:29:22',0,'2016-07-18 08:29:22'),(705,3,76,'PURRCV',1,75,'2016-07-18 08:29:22',0,'2016-07-18 08:29:22'),(706,3,76,'PURORDCF',1,75,'2016-07-18 08:29:22',0,'2016-07-18 08:29:22'),(707,3,76,'PURRCVC',1,75,'2016-07-18 08:29:22',0,'2016-07-18 08:29:22'),(708,3,76,'PURORLST',1,75,'2016-07-18 08:29:22',0,'2016-07-18 08:29:22'),(709,3,76,'PURRCVLS',1,75,'2016-07-18 08:29:22',0,'2016-07-18 08:29:22'),(710,3,76,'PUROUTGR',1,75,'2016-07-18 08:29:22',0,'2016-07-18 08:29:22'),(711,3,76,'PUPRRPT',1,75,'2016-07-18 08:29:22',0,'2016-07-18 08:29:22'),(712,3,76,'PURCNCL',1,75,'2016-07-18 08:29:22',0,'2016-07-18 08:29:22'),(713,3,76,'PURRCVCA',1,75,'2016-07-18 08:29:22',0,'2016-07-18 08:29:22'),(714,3,76,'PURSTSPL',1,75,'2016-07-18 08:29:22',0,'2016-07-18 08:29:22'),(715,3,76,'INVPURPR',1,75,'2016-07-18 08:29:22',0,'2016-07-18 08:29:22'),(716,3,76,'UMCONVNW',1,75,'2016-07-18 08:29:22',0,'2016-07-18 08:29:22'),(717,3,76,'PURUOMLS',1,75,'2016-07-18 08:29:22',0,'2016-07-18 08:29:22'),(718,3,76,'UM',1,75,'2016-07-18 08:29:23',0,'2016-07-18 08:29:23'),(719,3,76,'UML',1,75,'2016-07-18 08:29:23',0,'2016-07-18 08:29:23'),(720,3,76,'MUL',1,75,'2016-07-18 08:29:23',0,'2016-07-18 08:29:23'),(721,3,76,'LOGRPT',1,75,'2016-07-18 08:29:23',0,'2016-07-18 08:29:23'),(722,3,76,'UMACCSS',1,75,'2016-07-18 08:29:23',0,'2016-07-18 08:29:23'),(723,3,76,'ADMMENU',1,75,'2016-07-18 08:29:23',0,'2016-07-18 08:29:23'),(724,3,76,'USRADD',1,75,'2016-07-18 08:29:23',0,'2016-07-18 08:29:23'),(725,3,76,'BACKUP',1,75,'2016-07-18 08:29:23',0,'2016-07-18 08:29:23'),(726,3,76,'updversi',1,75,'2016-07-18 08:29:23',0,'2016-07-18 08:29:23'),(727,3,76,'upgraden',1,75,'2016-07-18 08:29:23',0,'2016-07-18 08:29:23'),(728,3,76,'MSTRCOMP',1,75,'2016-07-18 08:29:24',0,'2016-07-18 08:29:24'),(729,3,76,'PROJECT',1,75,'2016-07-18 08:29:24',0,'2016-07-18 08:29:24'),(730,3,76,'TERM',1,75,'2016-07-18 08:29:24',0,'2016-07-18 08:29:24'),(731,3,76,'MSMTRCD',1,75,'2016-07-18 08:29:24',0,'2016-07-18 08:29:24'),(732,3,76,'EMP',1,75,'2016-07-18 08:29:24',0,'2016-07-18 08:29:24'),(733,3,76,'AGENTSTP',1,75,'2016-07-18 08:29:24',0,'2016-07-18 08:29:24'),(734,3,76,'BNKSETUP',1,75,'2016-07-18 08:29:24',0,'2016-07-18 08:29:24'),(735,3,76,'ShipToST',1,75,'2016-07-18 08:29:24',0,'2016-07-18 08:29:24'),(736,3,76,'GRAPHSET',1,75,'2016-07-18 08:29:24',0,'2016-07-18 08:29:24');

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

/*!50001 DROP VIEW IF EXISTS `view_account_balance`*/;
/*!50001 CREATE TABLE `view_account_balance` (
  `companyID` tinyint NOT NULL,
  `acctID` tinyint NOT NULL,
  `acctName` tinyint NOT NULL,
  `year` tinyint NOT NULL,
  `period` tinyint NOT NULL,
  `closing` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_ar_inventory`*/;
/*!50001 CREATE TABLE `view_ar_inventory` (
  `companyID` tinyint NOT NULL,
  `customerID` tinyint NOT NULL,
  `formNo` tinyint NOT NULL,
  `salesinvoiceDate` tinyint NOT NULL,
  `totalReceivable` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_ar_open_position`*/;
/*!50001 CREATE TABLE `view_ar_open_position` (
  `companyID` tinyint NOT NULL,
  `customerID` tinyint NOT NULL,
  `customerName` tinyint NOT NULL,
  `phoneNumber1` tinyint NOT NULL,
  `email` tinyint NOT NULL,
  `due120` tinyint NOT NULL,
  `due90` tinyint NOT NULL,
  `due60` tinyint NOT NULL,
  `due30` tinyint NOT NULL,
  `due0` tinyint NOT NULL,
  `pastDue30` tinyint NOT NULL,
  `pastDue60` tinyint NOT NULL,
  `pastDue90` tinyint NOT NULL,
  `pastDue120` tinyint NOT NULL,
  `pastDue` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_balance_sheet`*/;
/*!50001 CREATE TABLE `view_balance_sheet` (
  `acctCode` tinyint NOT NULL,
  `acctName` tinyint NOT NULL,
  `acctGroupID` tinyint NOT NULL,
  `currentyeardebit` tinyint NOT NULL,
  `currentyearcredit` tinyint NOT NULL,
  `lastyeardebit` tinyint NOT NULL,
  `lastyearcredit` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_bank_reconcile`*/;
/*!50001 CREATE TABLE `view_bank_reconcile` (
  `ID` tinyint NOT NULL,
  `companyid` tinyint NOT NULL,
  `tableName` tinyint NOT NULL,
  `bankid` tinyint NOT NULL,
  `referenceNo` tinyint NOT NULL,
  `transDate` tinyint NOT NULL,
  `formNo` tinyint NOT NULL,
  `description` tinyint NOT NULL,
  `debitAmount` tinyint NOT NULL,
  `creditAmount` tinyint NOT NULL,
  `bankReconcileID` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_bank_reconcile_reverse`*/;
/*!50001 CREATE TABLE `view_bank_reconcile_reverse` (
  `bankReconcileID` tinyint NOT NULL,
  `ID` tinyint NOT NULL,
  `companyID` tinyint NOT NULL,
  `tableName` tinyint NOT NULL,
  `bankID` tinyint NOT NULL,
  `referenceNo` tinyint NOT NULL,
  `transDate` tinyint NOT NULL,
  `formNo` tinyint NOT NULL,
  `description` tinyint NOT NULL,
  `debitAmount` tinyint NOT NULL,
  `creditAmount` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_chart_of_acct_updateable`*/;
/*!50001 CREATE TABLE `view_chart_of_acct_updateable` (
  `ID` tinyint NOT NULL,
  `companyID` tinyint NOT NULL,
  `acctGroupID` tinyint NOT NULL,
  `acctCode` tinyint NOT NULL,
  `acctName` tinyint NOT NULL,
  `acctDesc` tinyint NOT NULL,
  `updateable` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_comp_acc_det`*/;
/*!50001 CREATE TABLE `view_comp_acc_det` (
  `ID` tinyint NOT NULL,
  `companyID` tinyint NOT NULL,
  `acctGroupID` tinyint NOT NULL,
  `acctID` tinyint NOT NULL,
  `year` tinyint NOT NULL,
  `period` tinyint NOT NULL,
  `amountdr` tinyint NOT NULL,
  `amountcr` tinyint NOT NULL,
  `total` tinyint NOT NULL,
  `createdBy` tinyint NOT NULL,
  `createdTS` tinyint NOT NULL,
  `updatedBy` tinyint NOT NULL,
  `updatedTS` tinyint NOT NULL,
  `is_delete` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_customer_aging`*/;
/*!50001 CREATE TABLE `view_customer_aging` (
  `companyID` tinyint NOT NULL,
  `customerID` tinyint NOT NULL,
  `customerName` tinyint NOT NULL,
  `phoneNumber1` tinyint NOT NULL,
  `email` tinyint NOT NULL,
  `current` tinyint NOT NULL,
  `month1` tinyint NOT NULL,
  `month2` tinyint NOT NULL,
  `month3` tinyint NOT NULL,
  `month4` tinyint NOT NULL,
  `month5` tinyint NOT NULL,
  `month6` tinyint NOT NULL,
  `month7` tinyint NOT NULL,
  `month8` tinyint NOT NULL,
  `month9` tinyint NOT NULL,
  `month10` tinyint NOT NULL,
  `month11` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_customer_statement`*/;
/*!50001 CREATE TABLE `view_customer_statement` (
  `ID` tinyint NOT NULL,
  `parent` tinyint NOT NULL,
  `companyID` tinyint NOT NULL,
  `customerID` tinyint NOT NULL,
  `transType` tinyint NOT NULL,
  `transDate` tinyint NOT NULL,
  `refNo` tinyint NOT NULL,
  `formNo` tinyint NOT NULL,
  `dr` tinyint NOT NULL,
  `cr` tinyint NOT NULL,
  `seq` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_expence_and_income`*/;
/*!50001 CREATE TABLE `view_expence_and_income` (
  `companyid` tinyint NOT NULL,
  `year` tinyint NOT NULL,
  `period` tinyint NOT NULL,
  `groupID` tinyint NOT NULL,
  `acctType` tinyint NOT NULL,
  `totalDr` tinyint NOT NULL,
  `totalCr` tinyint NOT NULL,
  `balance` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_gaf`*/;
/*!50001 CREATE TABLE `view_gaf` (
  `companyID` tinyint NOT NULL,
  `col1` tinyint NOT NULL,
  `col2` tinyint NOT NULL,
  `col3` tinyint NOT NULL,
  `col4` tinyint NOT NULL,
  `col5` tinyint NOT NULL,
  `col6` tinyint NOT NULL,
  `col7` tinyint NOT NULL,
  `col8` tinyint NOT NULL,
  `col9` tinyint NOT NULL,
  `col10` tinyint NOT NULL,
  `col11` tinyint NOT NULL,
  `col12` tinyint NOT NULL,
  `col13` tinyint NOT NULL,
  `col14` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_grn_report`*/;
/*!50001 CREATE TABLE `view_grn_report` (
  `companyID` tinyint NOT NULL,
  `unitMesure` tinyint NOT NULL,
  `ID` tinyint NOT NULL,
  `itemCode` tinyint NOT NULL,
  `itemName` tinyint NOT NULL,
  `poNo` tinyint NOT NULL,
  `PoDate` tinyint NOT NULL,
  `unitPrice` tinyint NOT NULL,
  `quantityOrder` tinyint NOT NULL,
  `total` tinyint NOT NULL,
  `totalRcv` tinyint NOT NULL,
  `QtyLeft` tinyint NOT NULL,
  `itemID` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_gst_report`*/;
/*!50001 CREATE TABLE `view_gst_report` (
  `companyid` tinyint NOT NULL,
  `gstRegisteredDate` tinyint NOT NULL,
  `taxablePeriod` tinyint NOT NULL,
  `financialYear` tinyint NOT NULL,
  `startDate` tinyint NOT NULL,
  `endDate` tinyint NOT NULL,
  `period` tinyint NOT NULL,
  `A1` tinyint NOT NULL,
  `A2` tinyint NOT NULL,
  `B5a` tinyint NOT NULL,
  `B5b` tinyint NOT NULL,
  `B6a` tinyint NOT NULL,
  `B6b` tinyint NOT NULL,
  `B7` tinyint NOT NULL,
  `B8` tinyint NOT NULL,
  `C10` tinyint NOT NULL,
  `C11` tinyint NOT NULL,
  `C12` tinyint NOT NULL,
  `C13` tinyint NOT NULL,
  `C14` tinyint NOT NULL,
  `C15` tinyint NOT NULL,
  `C16` tinyint NOT NULL,
  `C17` tinyint NOT NULL,
  `month6` tinyint NOT NULL,
  `C18` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_gst_tax`*/;
/*!50001 CREATE TABLE `view_gst_tax` (
  `lineNo` tinyint NOT NULL,
  `companyID` tinyint NOT NULL,
  `taxClass` tinyint NOT NULL,
  `taxClassName` tinyint NOT NULL,
  `taxGroup` tinyint NOT NULL,
  `taxGroupName` tinyint NOT NULL,
  `taxType` tinyint NOT NULL,
  `taxTypeName` tinyint NOT NULL,
  `transType` tinyint NOT NULL,
  `ref` tinyint NOT NULL,
  `transDate` tinyint NOT NULL,
  `customerID` tinyint NOT NULL,
  `customerName` tinyint NOT NULL,
  `itemName` tinyint NOT NULL,
  `amountExcludedTax` tinyint NOT NULL,
  `taxRate` tinyint NOT NULL,
  `taxAmount` tinyint NOT NULL,
  `amountIncludedTax` tinyint NOT NULL,
  `taxID` tinyint NOT NULL,
  `gst` tinyint NOT NULL,
  `journalID` tinyint NOT NULL,
  `formNo` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_inventory_statement`*/;
/*!50001 CREATE TABLE `view_inventory_statement` (
  `companyID` tinyint NOT NULL,
  `transactionDate` tinyint NOT NULL,
  `itemID` tinyint NOT NULL,
  `name` tinyint NOT NULL,
  `supplierCustomer` tinyint NOT NULL,
  `transactionCode` tinyint NOT NULL,
  `transactionType` tinyint NOT NULL,
  `formNo` tinyint NOT NULL,
  `locationID` tinyint NOT NULL,
  `location` tinyint NOT NULL,
  `unitOfMeasure` tinyint NOT NULL,
  `quantityIn` tinyint NOT NULL,
  `quantityOut` tinyint NOT NULL,
  `updateable` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_inventory_transaction`*/;
/*!50001 CREATE TABLE `view_inventory_transaction` (
  `indexing` tinyint NOT NULL,
  `ID` tinyint NOT NULL,
  `companyID` tinyint NOT NULL,
  `itemID` tinyint NOT NULL,
  `locationID` tinyint NOT NULL,
  `createdTS` tinyint NOT NULL,
  `supplierName` tinyint NOT NULL,
  `formNo` tinyint NOT NULL,
  `transDate` tinyint NOT NULL,
  `um` tinyint NOT NULL,
  `transType` tinyint NOT NULL,
  `qtyIn` tinyint NOT NULL,
  `qtyOut` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_inventorylist_subtotal`*/;
/*!50001 CREATE TABLE `view_inventorylist_subtotal` (
  `companyid` tinyint NOT NULL,
  `quantity` tinyint NOT NULL,
  `locationid` tinyint NOT NULL,
  `itemID` tinyint NOT NULL,
  `itemName` tinyint NOT NULL,
  `category` tinyint NOT NULL,
  `description` tinyint NOT NULL,
  `stockValue` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_item_details`*/;
/*!50001 CREATE TABLE `view_item_details` (
  `companyid` tinyint NOT NULL,
  `itemid` tinyint NOT NULL,
  `itemName` tinyint NOT NULL,
  `description` tinyint NOT NULL,
  `locationid` tinyint NOT NULL,
  `onHandQty` tinyint NOT NULL,
  `umID` tinyint NOT NULL,
  `acctID` tinyint NOT NULL,
  `location` tinyint NOT NULL,
  `unitOfMeasure` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_item_quantityonhand`*/;
/*!50001 CREATE TABLE `view_item_quantityonhand` (
  `companyID` tinyint NOT NULL,
  `locationID` tinyint NOT NULL,
  `itemID` tinyint NOT NULL,
  `itemCode` tinyint NOT NULL,
  `itemName` tinyint NOT NULL,
  `umID` tinyint NOT NULL,
  `quantityOnHand` tinyint NOT NULL,
  `itemTypeID` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_item_quantityonhand_confirm`*/;
/*!50001 CREATE TABLE `view_item_quantityonhand_confirm` (
  `companyID` tinyint NOT NULL,
  `locationID` tinyint NOT NULL,
  `itemID` tinyint NOT NULL,
  `itemCode` tinyint NOT NULL,
  `itemName` tinyint NOT NULL,
  `umID` tinyint NOT NULL,
  `quantityOnHand` tinyint NOT NULL,
  `itemTypeID` tinyint NOT NULL
) ENGINE=MyISAM */;

--
-- Temporary table structure for view `view_journal_no_acctcode`
--

/*!50001 DROP VIEW IF EXISTS `view_journal_no_acctcode`*/;
/*!50001 CREATE TABLE `view_journal_no_acctcode` (
  `ID` tinyint NOT NULL,
  `companyID` tinyint NOT NULL,
  `journalID` tinyint NOT NULL,
  `sequence` tinyint NOT NULL,
  `acctCode` tinyint NOT NULL,
  `projectID` tinyint NOT NULL,
  `description` tinyint NOT NULL,
  `amount_cr` tinyint NOT NULL,
  `amount_dr` tinyint NOT NULL,
  `currencyID` tinyint NOT NULL,
  `currency_amount` tinyint NOT NULL,
  `exchange_rate` tinyint NOT NULL,
  `enter_exchange_rate` tinyint NOT NULL,
  `period` tinyint NOT NULL,
  `year` tinyint NOT NULL,
  `formNo` tinyint NOT NULL,
  `supplier` tinyint NOT NULL,
  `line` tinyint NOT NULL,
  `status` tinyint NOT NULL,
  `createdBy` tinyint NOT NULL,
  `createdTS` tinyint NOT NULL,
  `updatedBy` tinyint NOT NULL,
  `updatedTS` tinyint NOT NULL,
  `is_delete` tinyint NOT NULL,
  `bankReconcileID` tinyint NOT NULL
) ENGINE=MyISAM */;

--
-- Temporary table structure for view `view_journal_no_detail`
--

/*!50001 DROP VIEW IF EXISTS `view_journal_no_detail`*/;
/*!50001 CREATE TABLE `view_journal_no_detail` (
  `ID` tinyint NOT NULL,
  `companyID` tinyint NOT NULL,
  `journalID` tinyint NOT NULL,
  `description` tinyint NOT NULL,
  `referrence` tinyint NOT NULL,
  `batch` tinyint NOT NULL,
  `module` tinyint NOT NULL,
  `effective_date` tinyint NOT NULL,
  `entered_date` tinyint NOT NULL,
  `period` tinyint NOT NULL,
  `year` tinyint NOT NULL,
  `total_amount_dr` tinyint NOT NULL,
  `total_amount_cr` tinyint NOT NULL,
  `total_amount` tinyint NOT NULL,
  `status` tinyint NOT NULL,
  `remarks` tinyint NOT NULL,
  `createdBy` tinyint NOT NULL,
  `createdTS` tinyint NOT NULL,
  `formNo` tinyint NOT NULL,
  `is_delete` tinyint NOT NULL
) ENGINE=MyISAM */;

--
-- Temporary table structure for view `view_journal_no_transaction`
--

/*!50001 DROP VIEW IF EXISTS `view_journal_no_transaction`*/;
/*!50001 CREATE TABLE `view_journal_no_transaction` (
  `ID` tinyint NOT NULL,
  `companyID` tinyint NOT NULL,
  `journalID` tinyint NOT NULL,
  `sequence` tinyint NOT NULL,
  `acctCode` tinyint NOT NULL,
  `projectID` tinyint NOT NULL,
  `description` tinyint NOT NULL,
  `amount_cr` tinyint NOT NULL,
  `amount_dr` tinyint NOT NULL,
  `currencyID` tinyint NOT NULL,
  `currency_amount` tinyint NOT NULL,
  `exchange_rate` tinyint NOT NULL,
  `enter_exchange_rate` tinyint NOT NULL,
  `period` tinyint NOT NULL,
  `year` tinyint NOT NULL,
  `formNo` tinyint NOT NULL,
  `supplier` tinyint NOT NULL,
  `line` tinyint NOT NULL,
  `status` tinyint NOT NULL,
  `createdBy` tinyint NOT NULL,
  `createdTS` tinyint NOT NULL,
  `updatedBy` tinyint NOT NULL,
  `updatedTS` tinyint NOT NULL,
  `is_delete` tinyint NOT NULL,
  `bankReconcileID` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_journal_table`*/;
/*!50001 CREATE TABLE `view_journal_table` (
  `ID` tinyint NOT NULL,
  `companyID` tinyint NOT NULL,
  `referenceNo` tinyint NOT NULL,
  `tableName` tinyint NOT NULL,
  `journalID` tinyint NOT NULL,
  `formNo` tinyint NOT NULL
) ENGINE=MyISAM */;

--
-- Temporary table structure for view `view_journal_total_dr_cr_different`
--

/*!50001 DROP VIEW IF EXISTS `view_journal_total_dr_cr_different`*/;
/*!50001 CREATE TABLE `view_journal_total_dr_cr_different` (
  `companyid` tinyint NOT NULL,
  `year` tinyint NOT NULL,
  `period` tinyint NOT NULL,
  `format(sum(``a``.``amount_dr``),2)` tinyint NOT NULL,
  `format(sum(``a``.``amount_cr``),2)` tinyint NOT NULL
) ENGINE=MyISAM */;

--
-- Temporary table structure for view `view_journal_total_header_detail_different`
--

/*!50001 DROP VIEW IF EXISTS `view_journal_total_header_detail_different`*/;
/*!50001 CREATE TABLE `view_journal_total_header_detail_different` (
  `companyid` tinyint NOT NULL,
  `year` tinyint NOT NULL,
  `period` tinyint NOT NULL,
  `journalid` tinyint NOT NULL,
  `total_amount_dr` tinyint NOT NULL,
  `total_amount_cr` tinyint NOT NULL,
  `format(sum(``b``.``amount_dr``),2)` tinyint NOT NULL,
  `format(sum(``b``.``amount_cr``),2)` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_open_ar_invoice`*/;
/*!50001 CREATE TABLE `view_open_ar_invoice` (
  `companyID` tinyint NOT NULL,
  `salesInvoiceDate` tinyint NOT NULL,
  `salesYear` tinyint NOT NULL,
  `salesMonth` tinyint NOT NULL,
  `slsMonth` tinyint NOT NULL,
  `totalAmount` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_salescreditnote`*/;
/*!50001 CREATE TABLE `view_salescreditnote` (
  `invoiceDetailID` tinyint NOT NULL,
  `unitOfMeasure` tinyint NOT NULL,
  `ID` tinyint NOT NULL,
  `invoiceID` tinyint NOT NULL,
  `doID` tinyint NOT NULL,
  `lineNo` tinyint NOT NULL,
  `itemID` tinyint NOT NULL,
  `umID` tinyint NOT NULL,
  `quantity` tinyint NOT NULL,
  `unitPrice` tinyint NOT NULL,
  `amountExcludedTax` tinyint NOT NULL,
  `taxID` tinyint NOT NULL,
  `taxRate` tinyint NOT NULL,
  `taxAmount` tinyint NOT NULL,
  `amountIncludedTax` tinyint NOT NULL,
  `accountID` tinyint NOT NULL,
  `createdBy` tinyint NOT NULL,
  `createdTS` tinyint NOT NULL,
  `updatedBy` tinyint NOT NULL,
  `updatedTS` tinyint NOT NULL,
  `code` tinyint NOT NULL,
  `itemCode` tinyint NOT NULL,
  `name` tinyint NOT NULL,
  `description` tinyint NOT NULL,
  `exactQty` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_salesdebitnote`*/;
/*!50001 CREATE TABLE `view_salesdebitnote` (
  `invoiceDetailID` tinyint NOT NULL,
  `unitOfMeasure` tinyint NOT NULL,
  `ID` tinyint NOT NULL,
  `invoiceID` tinyint NOT NULL,
  `doID` tinyint NOT NULL,
  `lineNo` tinyint NOT NULL,
  `itemID` tinyint NOT NULL,
  `umID` tinyint NOT NULL,
  `quantity` tinyint NOT NULL,
  `unitPrice` tinyint NOT NULL,
  `amountExcludedTax` tinyint NOT NULL,
  `taxID` tinyint NOT NULL,
  `taxRate` tinyint NOT NULL,
  `taxAmount` tinyint NOT NULL,
  `amountIncludedTax` tinyint NOT NULL,
  `accountID` tinyint NOT NULL,
  `createdBy` tinyint NOT NULL,
  `createdTS` tinyint NOT NULL,
  `updatedBy` tinyint NOT NULL,
  `updatedTS` tinyint NOT NULL,
  `code` tinyint NOT NULL,
  `itemCode` tinyint NOT NULL,
  `name` tinyint NOT NULL,
  `description` tinyint NOT NULL,
  `exactQty` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_search`*/;
/*!50001 CREATE TABLE `view_search` (
  `ID` tinyint NOT NULL,
  `companyID` tinyint NOT NULL,
  `searchLink` tinyint NOT NULL,
  `searchKey` tinyint NOT NULL,
  `transDate` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_cash_sales`*/;
/*!50001 CREATE TABLE `view_serial_comp_cash_sales` (
  `companyID` tinyint NOT NULL,
  `nextSerialNo` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_delivery_order`*/;
/*!50001 CREATE TABLE `view_serial_comp_delivery_order` (
  `companyID` tinyint NOT NULL,
  `nextSerialNo` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_gst_transaction`*/;
/*!50001 CREATE TABLE `view_serial_comp_gst_transaction` (
  `companyID` tinyint NOT NULL,
  `nextSerialNo` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_historical_customer_invoice`*/;
/*!50001 CREATE TABLE `view_serial_comp_historical_customer_invoice` (
  `companyID` tinyint NOT NULL,
  `nextSerialNo` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_historical_supplier_invoice`*/;
/*!50001 CREATE TABLE `view_serial_comp_historical_supplier_invoice` (
  `companyID` tinyint NOT NULL,
  `nextSerialNo` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_location_transfer`*/;
/*!50001 CREATE TABLE `view_serial_comp_location_transfer` (
  `companyID` tinyint NOT NULL,
  `nextSerialNo` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_payment`*/;
/*!50001 CREATE TABLE `view_serial_comp_payment` (
  `companyID` tinyint NOT NULL,
  `nextSerialNo` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_payment_others`*/;
/*!50001 CREATE TABLE `view_serial_comp_payment_others` (
  `companyID` tinyint NOT NULL,
  `nextSerialNo` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_purchase_order`*/;
/*!50001 CREATE TABLE `view_serial_comp_purchase_order` (
  `companyID` tinyint NOT NULL,
  `nextSerialNo` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_quotation`*/;
/*!50001 CREATE TABLE `view_serial_comp_quotation` (
  `companyID` tinyint NOT NULL,
  `nextSerialNo` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_receive_item`*/;
/*!50001 CREATE TABLE `view_serial_comp_receive_item` (
  `companyID` tinyint NOT NULL,
  `nextSerialNo` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_receive_payment`*/;
/*!50001 CREATE TABLE `view_serial_comp_receive_payment` (
  `companyID` tinyint NOT NULL,
  `nextSerialNo` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_receive_payment_others`*/;
/*!50001 CREATE TABLE `view_serial_comp_receive_payment_others` (
  `companyID` tinyint NOT NULL,
  `nextSerialNo` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_sales_creditnote`*/;
/*!50001 CREATE TABLE `view_serial_comp_sales_creditnote` (
  `companyID` tinyint NOT NULL,
  `nextSerialNo` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_sales_debitnote`*/;
/*!50001 CREATE TABLE `view_serial_comp_sales_debitnote` (
  `companyID` tinyint NOT NULL,
  `nextSerialNo` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_sales_invoice`*/;
/*!50001 CREATE TABLE `view_serial_comp_sales_invoice` (
  `companyID` tinyint NOT NULL,
  `nextSerialNo` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_sales_order`*/;
/*!50001 CREATE TABLE `view_serial_comp_sales_order` (
  `companyID` tinyint NOT NULL,
  `nextSerialNo` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_supplier_creditnote`*/;
/*!50001 CREATE TABLE `view_serial_comp_supplier_creditnote` (
  `companyID` tinyint NOT NULL,
  `nextSerialNo` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_supplier_debitnote`*/;
/*!50001 CREATE TABLE `view_serial_comp_supplier_debitnote` (
  `companyID` tinyint NOT NULL,
  `nextSerialNo` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_supplier_invoice`*/;
/*!50001 CREATE TABLE `view_serial_comp_supplier_invoice` (
  `companyID` tinyint NOT NULL,
  `nextSerialNo` tinyint NOT NULL
) ENGINE=MyISAM */;

--
-- Temporary table structure for view `view_serial_zakat`
--

/*!50001 DROP VIEW IF EXISTS `view_serial_zakat`*/;
/*!50001 CREATE TABLE `view_serial_zakat` (
  `companyID` tinyint NOT NULL,
  `nextSerialNo` tinyint NOT NULL
) ENGINE=MyISAM */;

--
-- Temporary table structure for view `view_summary_debit_credit`
--

/*!50001 DROP VIEW IF EXISTS `view_summary_debit_credit`*/;
/*!50001 CREATE TABLE `view_summary_debit_credit` (
  `companyid` tinyint NOT NULL,
  `acctCode` tinyint NOT NULL,
  `year` tinyint NOT NULL,
  `period` tinyint NOT NULL,
  `total_dr` tinyint NOT NULL,
  `total_cr` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_supplier_aging`*/;
/*!50001 CREATE TABLE `view_supplier_aging` (
  `companyID` tinyint NOT NULL,
  `supplierID` tinyint NOT NULL,
  `supplierName` tinyint NOT NULL,
  `phoneNumber1` tinyint NOT NULL,
  `email` tinyint NOT NULL,
  `current` tinyint NOT NULL,
  `month1` tinyint NOT NULL,
  `month2` tinyint NOT NULL,
  `month3` tinyint NOT NULL,
  `month4` tinyint NOT NULL,
  `month5` tinyint NOT NULL,
  `month6` tinyint NOT NULL,
  `month7` tinyint NOT NULL,
  `month8` tinyint NOT NULL,
  `month9` tinyint NOT NULL,
  `month10` tinyint NOT NULL,
  `month11` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_supplier_statement`*/;
/*!50001 CREATE TABLE `view_supplier_statement` (
  `ID` tinyint NOT NULL,
  `parent` tinyint NOT NULL,
  `companyID` tinyint NOT NULL,
  `supplierID` tinyint NOT NULL,
  `transType` tinyint NOT NULL,
  `transDate` tinyint NOT NULL,
  `refNo` tinyint NOT NULL,
  `formNo` tinyint NOT NULL,
  `dr` tinyint NOT NULL,
  `cr` tinyint NOT NULL,
  `seq` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_suppliercreditnote`*/;
/*!50001 CREATE TABLE `view_suppliercreditnote` (
  `invoiceDetailID` tinyint NOT NULL,
  `invoiceUm` tinyint NOT NULL,
  `ID` tinyint NOT NULL,
  `invoiceID` tinyint NOT NULL,
  `receiveID` tinyint NOT NULL,
  `lineNo` tinyint NOT NULL,
  `itemID` tinyint NOT NULL,
  `itemname` tinyint NOT NULL,
  `itemdescription` tinyint NOT NULL,
  `umID` tinyint NOT NULL,
  `quantity` tinyint NOT NULL,
  `unitPrice` tinyint NOT NULL,
  `amountExcludedTax` tinyint NOT NULL,
  `taxID` tinyint NOT NULL,
  `taxRate` tinyint NOT NULL,
  `taxAmount` tinyint NOT NULL,
  `amountIncludedTax` tinyint NOT NULL,
  `accountID` tinyint NOT NULL,
  `createdBy` tinyint NOT NULL,
  `createdTS` tinyint NOT NULL,
  `updatedBy` tinyint NOT NULL,
  `updatedTS` tinyint NOT NULL,
  `exactQty` tinyint NOT NULL,
  `unitOfMeasure` tinyint NOT NULL,
  `receiveDetailID` tinyint NOT NULL,
  `code` tinyint NOT NULL,
  `itemCode` tinyint NOT NULL,
  `name` tinyint NOT NULL,
  `description` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_supplierdebitnote`*/;
/*!50001 CREATE TABLE `view_supplierdebitnote` (
  `invoiceDetailID` tinyint NOT NULL,
  `ID` tinyint NOT NULL,
  `invoiceID` tinyint NOT NULL,
  `receiveID` tinyint NOT NULL,
  `lineNo` tinyint NOT NULL,
  `itemID` tinyint NOT NULL,
  `itemname` tinyint NOT NULL,
  `itemdescription` tinyint NOT NULL,
  `umID` tinyint NOT NULL,
  `quantity` tinyint NOT NULL,
  `unitPrice` tinyint NOT NULL,
  `amountExcludedTax` tinyint NOT NULL,
  `taxID` tinyint NOT NULL,
  `taxRate` tinyint NOT NULL,
  `taxAmount` tinyint NOT NULL,
  `amountIncludedTax` tinyint NOT NULL,
  `accountID` tinyint NOT NULL,
  `createdBy` tinyint NOT NULL,
  `createdTS` tinyint NOT NULL,
  `updatedBy` tinyint NOT NULL,
  `updatedTS` tinyint NOT NULL,
  `unitOfMeasure` tinyint NOT NULL,
  `receiveDetailID` tinyint NOT NULL,
  `code` tinyint NOT NULL,
  `itemCode` tinyint NOT NULL,
  `name` tinyint NOT NULL,
  `description` tinyint NOT NULL,
  `exactQty` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_total_comp_sales_creditnote`*/;
/*!50001 CREATE TABLE `view_total_comp_sales_creditnote` (
  `ID` tinyint NOT NULL,
  `totalTaxAmount` tinyint NOT NULL,
  `totalAmount` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_total_comp_sales_debitnote`*/;
/*!50001 CREATE TABLE `view_total_comp_sales_debitnote` (
  `ID` tinyint NOT NULL,
  `totalTaxAmount` tinyint NOT NULL,
  `totalAmount` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_total_comp_sales_invoice`*/;
/*!50001 CREATE TABLE `view_total_comp_sales_invoice` (
  `ID` tinyint NOT NULL,
  `totalTaxAmount` tinyint NOT NULL,
  `totalAmount` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_total_comp_supplier_creditnote`*/;
/*!50001 CREATE TABLE `view_total_comp_supplier_creditnote` (
  `ID` tinyint NOT NULL,
  `totalTaxAmount` tinyint NOT NULL,
  `totalAmount` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_total_comp_supplier_debitnote`*/;
/*!50001 CREATE TABLE `view_total_comp_supplier_debitnote` (
  `ID` tinyint NOT NULL,
  `totalTaxAmount` tinyint NOT NULL,
  `totalAmount` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_total_comp_supplier_invoice`*/;
/*!50001 CREATE TABLE `view_total_comp_supplier_invoice` (
  `ID` tinyint NOT NULL,
  `totalTaxAmount` tinyint NOT NULL,
  `totalAmount` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_transaction_summary`*/;
/*!50001 CREATE TABLE `view_transaction_summary` (
  `tableName` tinyint NOT NULL,
  `transID` tinyint NOT NULL,
  `companyid` tinyint NOT NULL,
  `year` tinyint NOT NULL,
  `Jan` tinyint NOT NULL,
  `Feb` tinyint NOT NULL,
  `Mar` tinyint NOT NULL,
  `Apr` tinyint NOT NULL,
  `may` tinyint NOT NULL,
  `Jun` tinyint NOT NULL,
  `Jul` tinyint NOT NULL,
  `Aug` tinyint NOT NULL,
  `Sept` tinyint NOT NULL,
  `Oct` tinyint NOT NULL,
  `Nov` tinyint NOT NULL,
  `Dec` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_unpost_ap_creditnote`*/;
/*!50001 CREATE TABLE `view_unpost_ap_creditnote` (
  `supplier` tinyint NOT NULL,
  `creditnoteID` tinyint NOT NULL,
  `lineNo` tinyint NOT NULL,
  `projectID` tinyint NOT NULL,
  `supplierInvoiceID` tinyint NOT NULL,
  `formNo` tinyint NOT NULL,
  `companyID` tinyint NOT NULL,
  `supplierID` tinyint NOT NULL,
  `supplierInvoiceNo` tinyint NOT NULL,
  `locationID` tinyint NOT NULL,
  `umID` tinyint NOT NULL,
  `quantity` tinyint NOT NULL,
  `itemID` tinyint NOT NULL,
  `itemName` tinyint NOT NULL,
  `amountExcludedtax` tinyint NOT NULL,
  `taxid` tinyint NOT NULL,
  `taxamount` tinyint NOT NULL,
  `drAccountID` tinyint NOT NULL,
  `crAccountID` tinyint NOT NULL,
  `drTaxAccountID` tinyint NOT NULL,
  `crTaxAccountID` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_unpost_ap_debitnote`*/;
/*!50001 CREATE TABLE `view_unpost_ap_debitnote` (
  `supplier` tinyint NOT NULL,
  `debitnoteID` tinyint NOT NULL,
  `lineNo` tinyint NOT NULL,
  `projectID` tinyint NOT NULL,
  `typeID` tinyint NOT NULL,
  `typeDetailID` tinyint NOT NULL,
  `formNo` tinyint NOT NULL,
  `companyID` tinyint NOT NULL,
  `supplierID` tinyint NOT NULL,
  `supplierInvoiceNo` tinyint NOT NULL,
  `locationID` tinyint NOT NULL,
  `umID` tinyint NOT NULL,
  `quantity` tinyint NOT NULL,
  `itemID` tinyint NOT NULL,
  `itemName` tinyint NOT NULL,
  `amountExcludedtax` tinyint NOT NULL,
  `taxid` tinyint NOT NULL,
  `taxamount` tinyint NOT NULL,
  `drAccountID` tinyint NOT NULL,
  `crAccountID` tinyint NOT NULL,
  `drTaxAccountID` tinyint NOT NULL,
  `crTaxAccountID` tinyint NOT NULL,
  `cogsAcctID` tinyint NOT NULL,
  `inventoriesAcctID` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_unpost_ap_invoice`*/;
/*!50001 CREATE TABLE `view_unpost_ap_invoice` (
  `supplier` tinyint NOT NULL,
  `invoiceID` tinyint NOT NULL,
  `formNo` tinyint NOT NULL,
  `companyID` tinyint NOT NULL,
  `supplierID` tinyint NOT NULL,
  `lineNo` tinyint NOT NULL,
  `itemID` tinyint NOT NULL,
  `itemName` tinyint NOT NULL,
  `amountExcludedtax` tinyint NOT NULL,
  `taxid` tinyint NOT NULL,
  `taxamount` tinyint NOT NULL,
  `drAccountID` tinyint NOT NULL,
  `crAccountID` tinyint NOT NULL,
  `drTaxAccountID` tinyint NOT NULL,
  `crTaxAccountID` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_unpost_ar_creditnote`*/;
/*!50001 CREATE TABLE `view_unpost_ar_creditnote` (
  `customer` tinyint NOT NULL,
  `salesinvoiceID` tinyint NOT NULL,
  `creditnoteID` tinyint NOT NULL,
  `projectID` tinyint NOT NULL,
  `typeID` tinyint NOT NULL,
  `typeDetailID` tinyint NOT NULL,
  `formNo` tinyint NOT NULL,
  `companyID` tinyint NOT NULL,
  `customerID` tinyint NOT NULL,
  `locationID` tinyint NOT NULL,
  `salesInvoiceNo` tinyint NOT NULL,
  `lineNo` tinyint NOT NULL,
  `itemID` tinyint NOT NULL,
  `umID` tinyint NOT NULL,
  `quantity` tinyint NOT NULL,
  `itemName` tinyint NOT NULL,
  `amountExcludedtax` tinyint NOT NULL,
  `taxid` tinyint NOT NULL,
  `taxamount` tinyint NOT NULL,
  `drAccountID` tinyint NOT NULL,
  `crAccountID` tinyint NOT NULL,
  `drTaxAccountID` tinyint NOT NULL,
  `crTaxAccountID` tinyint NOT NULL,
  `cogsAcctID` tinyint NOT NULL,
  `inventoriesAcctID` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_unpost_ar_debitnote`*/;
/*!50001 CREATE TABLE `view_unpost_ar_debitnote` (
  `customer` tinyint NOT NULL,
  `salesinvoiceID` tinyint NOT NULL,
  `debitnoteID` tinyint NOT NULL,
  `projectID` tinyint NOT NULL,
  `typeID` tinyint NOT NULL,
  `typeDetailID` tinyint NOT NULL,
  `formNo` tinyint NOT NULL,
  `companyID` tinyint NOT NULL,
  `customerID` tinyint NOT NULL,
  `locationID` tinyint NOT NULL,
  `salesInvoiceNo` tinyint NOT NULL,
  `lineNo` tinyint NOT NULL,
  `itemID` tinyint NOT NULL,
  `umID` tinyint NOT NULL,
  `quantity` tinyint NOT NULL,
  `itemName` tinyint NOT NULL,
  `amountExcludedtax` tinyint NOT NULL,
  `taxid` tinyint NOT NULL,
  `taxamount` tinyint NOT NULL,
  `currencyID` tinyint NOT NULL,
  `drAccountID` tinyint NOT NULL,
  `crAccountID` tinyint NOT NULL,
  `drTaxAccountID` tinyint NOT NULL,
  `crTaxAccountID` tinyint NOT NULL,
  `cogsAcctID` tinyint NOT NULL,
  `inventoriesAcctID` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_unpost_ar_invoice`*/;
/*!50001 CREATE TABLE `view_unpost_ar_invoice` (
  `projectID` tinyint NOT NULL,
  `customer` tinyint NOT NULL,
  `invoiceID` tinyint NOT NULL,
  `formNo` tinyint NOT NULL,
  `companyID` tinyint NOT NULL,
  `customerID` tinyint NOT NULL,
  `itemID` tinyint NOT NULL,
  `lineNo` tinyint NOT NULL,
  `itemName` tinyint NOT NULL,
  `amountExcludedtax` tinyint NOT NULL,
  `taxid` tinyint NOT NULL,
  `taxamount` tinyint NOT NULL,
  `drAccountID` tinyint NOT NULL,
  `crAccountID` tinyint NOT NULL,
  `drTaxAccountID` tinyint NOT NULL,
  `crTaxAccountID` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_unpost_ar_payment`*/;
/*!50001 CREATE TABLE `view_unpost_ar_payment` (
  `paymentID` tinyint NOT NULL,
  `formNo` tinyint NOT NULL,
  `companyID` tinyint NOT NULL,
  `customerID` tinyint NOT NULL,
  `purchaseInvoiceID` tinyint NOT NULL,
  `customerName` tinyint NOT NULL,
  `lineNo` tinyint NOT NULL,
  `paymentDetailID` tinyint NOT NULL,
  `item` tinyint NOT NULL,
  `amtPaid_amtAppl` tinyint NOT NULL,
  `discount_bankCharges` tinyint NOT NULL,
  `drAccountID` tinyint NOT NULL,
  `crAccountID` tinyint NOT NULL,
  `drDiscountAccountID` tinyint NOT NULL,
  `crDiscountAccountID` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_unpost_cash_purchase`*/;
/*!50001 CREATE TABLE `view_unpost_cash_purchase` (
  `lineNo` tinyint NOT NULL,
  `quantity` tinyint NOT NULL,
  `unitPrice` tinyint NOT NULL,
  `itemID` tinyint NOT NULL,
  `itemdescription` tinyint NOT NULL,
  `umID` tinyint NOT NULL,
  `locationID` tinyint NOT NULL,
  `othersPaymentID` tinyint NOT NULL,
  `formNo` tinyint NOT NULL,
  `companyID` tinyint NOT NULL,
  `supplierID` tinyint NOT NULL,
  `purchaseInvoiceID` tinyint NOT NULL,
  `paymentDetailID` tinyint NOT NULL,
  `supplierInvoiceNo` tinyint NOT NULL,
  `ID` tinyint NOT NULL,
  `itemName` tinyint NOT NULL,
  `amountExcludedTax` tinyint NOT NULL,
  `taxid` tinyint NOT NULL,
  `taxAmount` tinyint NOT NULL,
  `projectID` tinyint NOT NULL,
  `itemTypeID` tinyint NOT NULL,
  `drAccountID` tinyint NOT NULL,
  `crAccountID` tinyint NOT NULL,
  `drDiscountAccountID` tinyint NOT NULL,
  `crDiscountAccountID` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_unpost_cash_sale`*/;
/*!50001 CREATE TABLE `view_unpost_cash_sale` (
  `projectID` tinyint NOT NULL,
  `customer` tinyint NOT NULL,
  `invoiceID` tinyint NOT NULL,
  `typeID` tinyint NOT NULL,
  `typeDetailID` tinyint NOT NULL,
  `locationID` tinyint NOT NULL,
  `quantity` tinyint NOT NULL,
  `formNo` tinyint NOT NULL,
  `companyID` tinyint NOT NULL,
  `itemID` tinyint NOT NULL,
  `umID` tinyint NOT NULL,
  `lineNo` tinyint NOT NULL,
  `currencyID` tinyint NOT NULL,
  `itemName` tinyint NOT NULL,
  `amountExcludedtax` tinyint NOT NULL,
  `taxid` tinyint NOT NULL,
  `taxamount` tinyint NOT NULL,
  `drAccountID` tinyint NOT NULL,
  `crAccountID` tinyint NOT NULL,
  `drTaxAccountID` tinyint NOT NULL,
  `crTaxAccountID` tinyint NOT NULL,
  `cogsAcctID` tinyint NOT NULL,
  `inventoriesAcctID` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_unpost_do`*/;
/*!50001 CREATE TABLE `view_unpost_do` (
  `deliveryOrderID` tinyint NOT NULL,
  `customerID` tinyint NOT NULL,
  `projectID` tinyint NOT NULL,
  `customer` tinyint NOT NULL,
  `invoiceID` tinyint NOT NULL,
  `typeID` tinyint NOT NULL,
  `typeDetailID` tinyint NOT NULL,
  `locationID` tinyint NOT NULL,
  `quantity` tinyint NOT NULL,
  `formNo` tinyint NOT NULL,
  `companyID` tinyint NOT NULL,
  `itemID` tinyint NOT NULL,
  `itemName` tinyint NOT NULL,
  `amountExcludedtax` tinyint NOT NULL,
  `taxid` tinyint NOT NULL,
  `taxamount` tinyint NOT NULL,
  `drAccountID` tinyint NOT NULL,
  `crAccountID` tinyint NOT NULL,
  `drTaxAccountID` tinyint NOT NULL,
  `crTaxAccountID` tinyint NOT NULL,
  `cogsAcctID` tinyint NOT NULL,
  `inventoriesAcctID` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_unpost_gst_transaction`*/;
/*!50001 CREATE TABLE `view_unpost_gst_transaction` (
  `paymentID` tinyint NOT NULL,
  `formNo` tinyint NOT NULL,
  `companyID` tinyint NOT NULL,
  `supplierID` tinyint NOT NULL,
  `purchaseInvoiceID` tinyint NOT NULL,
  `supplierName` tinyint NOT NULL,
  `lineNo` tinyint NOT NULL,
  `paymentDetailID` tinyint NOT NULL,
  `supplierInvoiceNo` tinyint NOT NULL,
  `item` tinyint NOT NULL,
  `amtPaid_amtAppl` tinyint NOT NULL,
  `discount_bankCharges` tinyint NOT NULL,
  `drAccountID` tinyint NOT NULL,
  `crAccountID` tinyint NOT NULL,
  `drDiscountAccountID` tinyint NOT NULL,
  `crDiscountAccountID` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_unpost_other_payment`*/;
/*!50001 CREATE TABLE `view_unpost_other_payment` (
  `othersPaymentID` tinyint NOT NULL,
  `formNo` tinyint NOT NULL,
  `companyID` tinyint NOT NULL,
  `supplierID` tinyint NOT NULL,
  `purchaseInvoiceID` tinyint NOT NULL,
  `paymentDetailID` tinyint NOT NULL,
  `supplierInvoiceNo` tinyint NOT NULL,
  `lineNo` tinyint NOT NULL,
  `itemdescription` tinyint NOT NULL,
  `amountExcludedtax` tinyint NOT NULL,
  `taxid` tinyint NOT NULL,
  `taxamount` tinyint NOT NULL,
  `drAccountID` tinyint NOT NULL,
  `crAccountID` tinyint NOT NULL,
  `drTaxAccountID` tinyint NOT NULL,
  `crTaxAccountID` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_unpost_other_receive`*/;
/*!50001 CREATE TABLE `view_unpost_other_receive` (
  `projectID` tinyint NOT NULL,
  `receiveFrom` tinyint NOT NULL,
  `otherReceiveID` tinyint NOT NULL,
  `formNo` tinyint NOT NULL,
  `companyID` tinyint NOT NULL,
  `lineNo` tinyint NOT NULL,
  `itemdescription` tinyint NOT NULL,
  `amountExcludedtax` tinyint NOT NULL,
  `taxid` tinyint NOT NULL,
  `taxamount` tinyint NOT NULL,
  `drAccountID` tinyint NOT NULL,
  `crAccountID` tinyint NOT NULL,
  `drTaxAccountID` tinyint NOT NULL,
  `crTaxAccountID` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_unpost_payment`*/;
/*!50001 CREATE TABLE `view_unpost_payment` (
  `paymentID` tinyint NOT NULL,
  `formNo` tinyint NOT NULL,
  `companyID` tinyint NOT NULL,
  `supplierID` tinyint NOT NULL,
  `purchaseInvoiceID` tinyint NOT NULL,
  `supplierName` tinyint NOT NULL,
  `lineNo` tinyint NOT NULL,
  `paymentDetailID` tinyint NOT NULL,
  `supplierInvoiceNo` tinyint NOT NULL,
  `item` tinyint NOT NULL,
  `amtPaid_amtAppl` tinyint NOT NULL,
  `discount_bankCharges` tinyint NOT NULL,
  `drAccountID` tinyint NOT NULL,
  `crAccountID` tinyint NOT NULL,
  `drDiscountAccountID` tinyint NOT NULL,
  `crDiscountAccountID` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_unpost_receive_item`*/;
/*!50001 CREATE TABLE `view_unpost_receive_item` (
  `receiveID` tinyint NOT NULL,
  `companyID` tinyint NOT NULL,
  `locationID` tinyint NOT NULL,
  `transactionDate` tinyint NOT NULL,
  `supplierID` tinyint NOT NULL,
  `formNo` tinyint NOT NULL,
  `lineNo` tinyint NOT NULL,
  `itemID` tinyint NOT NULL,
  `itemName` tinyint NOT NULL,
  `exchangeRate` tinyint NOT NULL,
  `unitPrice` tinyint NOT NULL,
  `quantityReceived` tinyint NOT NULL,
  `umID` tinyint NOT NULL,
  `amount` tinyint NOT NULL,
  `drAccountID` tinyint NOT NULL,
  `crAccountID` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_wakaf_accrual`*/;
/*!50001 CREATE TABLE `view_wakaf_accrual` (
  `companyID` tinyint NOT NULL,
  `acctID` tinyint NOT NULL,
  `year` tinyint NOT NULL,
  `totalAmount` tinyint NOT NULL
) ENGINE=MyISAM */;

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

/*!50001 DROP VIEW IF EXISTS `view_wakaf_from_profit`*/;
/*!50001 CREATE TABLE `view_wakaf_from_profit` (
  `companyid` tinyint NOT NULL,
  `year` tinyint NOT NULL,
  `acctType` tinyint NOT NULL,
  `totalDr` tinyint NOT NULL,
  `totalCr` tinyint NOT NULL
) ENGINE=MyISAM */;

--
-- 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,'','','','','2016-07-18 05:32:36',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,'','','','','2016-07-18 05:32:36',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,'','','','','2016-07-18 05:32:36',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','','','','2016-07-18 05:32:36',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/','2016-07-18 05:32:36',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','2016-07-18 05:32:36',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','2016-07-18 05:32:36',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','2016-07-18 05:32:36',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','2016-07-18 05:32:36',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','2016-07-18 05:32:36',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','2016-07-18 05:32:36',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','2016-07-18 05:32:36',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','2016-07-18 05:32:36',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','2016-07-18 05:32:36',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,'2016-07-18 05:32:36',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,'2016-07-18 05:32:36',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,'2016-07-18 05:32:36',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,'2016-07-18 05:32:36',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,'2016-07-18 05:32:36',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,'2016-07-18 05:32:36',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,'2016-07-18 05:32:36',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,'2016-07-18 05:32:36',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,'2016-07-18 05:32:36',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,'2016-07-18 05:32:36',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,'2016-07-18 05:32:36',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,'2016-07-18 05:32:36',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,'2016-07-18 05:32:36',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,'2016-07-18 05:32:36',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,
  `amountAdjust` double NOT 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` smallint(6) NOT NULL,
  `checkAble` tinyint(1) NOT NULL,
  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,
  `serialNo` int(11) NOT NULL DEFAULT '1',
  `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',
  `journalNo` varchar(32) CHARACTER SET latin1 NOT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;

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

DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `trigger_before_insert_zakat_summary_add_serialNo` BEFORE INSERT ON `zakat_summary`

 FOR EACH ROW set new.serialNo = (select nextSerialNo 

                           from view_serial_zakat 

                           where companyID = new.companyID) */;;
DELIMITER ;

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

/*!50001 DROP TABLE IF EXISTS `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 TABLE IF EXISTS `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 TABLE IF EXISTS `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 TABLE IF EXISTS `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 TABLE IF EXISTS `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`,`a`.`bankReconcileID` AS `bankReconcileID` 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 ((`c`.`status` = 1) and (`a`.`is_delete` = 0) and (`c`.`is_delete` = 0)) union select `a`.`ID` AS `ID`,`a`.`companyID` AS `companyid`,'comp_unpresented_check' AS `tableName`,`a`.`bankID` AS `bankid`,`a`.`referenceNo` AS `referenceNo`,`a`.`transDate` AS `transDate`,`a`.`transNo` AS `formNo`,`a`.`desc` AS `description`,`a`.`debit` AS `debitAmount`,`a`.`credit` AS `creditAmount`,`a`.`bankReconcileID` AS `bankReconcileID` from (`comp_unpresented_check` `a` left join `comp_bank` `b` on((`a`.`bankID` = `b`.`ID`))) where (`a`.`is_delete` = 0) */;

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

/*!50001 DROP TABLE IF EXISTS `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 TABLE IF EXISTS `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 TABLE IF EXISTS `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`.`ID` AS `acctID`,`b`.`year` AS `year`,`b`.`period` AS `period`,(select coalesce(sum(`comp_journal_detail`.`amount_dr`),0) from (`comp_journal` join `comp_journal_detail`) where ((`comp_journal_detail`.`companyID` = `a`.`companyID`) and (`comp_journal_detail`.`acctCode` = `a`.`ID`) and (`comp_journal_detail`.`period` = `b`.`period`) and (`comp_journal_detail`.`year` = `b`.`year`) and (`comp_journal`.`companyID` = `comp_journal_detail`.`companyID`) and (`comp_journal`.`journalID` = `comp_journal_detail`.`journalID`) and (`comp_journal`.`status` = 1) and (`comp_journal`.`is_delete` = 0) 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` join `comp_journal_detail`) where ((`comp_journal_detail`.`companyID` = `a`.`companyID`) and (`comp_journal_detail`.`acctCode` = `a`.`ID`) and (`comp_journal_detail`.`period` = `b`.`period`) and (`comp_journal_detail`.`year` = `b`.`year`) and (`comp_journal`.`companyID` = `comp_journal_detail`.`companyID`) and (`comp_journal`.`journalID` = `comp_journal_detail`.`journalID`) and (`comp_journal`.`status` = 1) and (`comp_journal`.`is_delete` = 0) 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` join `comp_journal_detail`) where ((`comp_journal_detail`.`companyID` = `a`.`companyID`) and (`comp_journal_detail`.`acctCode` = `a`.`ID`) and (`comp_journal_detail`.`period` = `b`.`period`) and (`comp_journal_detail`.`year` = `b`.`year`) and (`comp_journal`.`companyID` = `comp_journal_detail`.`companyID`) and (`comp_journal`.`journalID` = `comp_journal_detail`.`journalID`) and (`comp_journal`.`status` = 1) and (`comp_journal`.`is_delete` = 0) 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_chart_of_acct` `a` left join `view_summary_debit_credit` `b` on((`a`.`ID` = `b`.`acctCode`))) where ((`a`.`companyID` > 0) and (`a`.`ID` > 0) and (`b`.`year` > 0) and (`b`.`period` > 0)) */;

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

/*!50001 DROP TABLE IF EXISTS `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`.`totalPayable`) 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`.`totalPayable`) 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`.`totalPayable`) 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`.`totalPayable`) 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`.`totalPayable`) 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`.`totalPayable`) 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`.`totalPayable`) 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`.`totalPayable`) 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`.`totalPayable`) 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`.`totalPayable`) 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`.`totalPayable`) 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`.`totalPayable`) 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` where (`a`.`is_delete` = 0) */;

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

/*!50001 DROP TABLE IF EXISTS `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`,`b`.`customerPoNo` 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 TABLE IF EXISTS `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`,`c`.`acctTypeID` */;

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

/*!50001 DROP TABLE IF EXISTS `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 TABLE IF EXISTS `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 TABLE IF EXISTS `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 coalesce(sum(`view_gst_tax`.`amountExcludedTax`),0) from `view_gst_tax` where ((`view_gst_tax`.`companyID` = `a`.`companyID`) and (find_in_set(`view_gst_tax`.`gst`,(select `comp_gst_field_mapping`.`taxCode` from `comp_gst_field_mapping` where ((`comp_gst_field_mapping`.`companyID` = `a`.`companyID`) and (`comp_gst_field_mapping`.`item` = 'B5a')))) > 0) and (`view_gst_tax`.`transDate` between `a`.`startDate` and `a`.`endDate`))) AS `B5a`,(select coalesce(sum(`view_gst_tax`.`taxAmount`),0) from `view_gst_tax` where ((`view_gst_tax`.`companyID` = `a`.`companyID`) and (find_in_set(`view_gst_tax`.`gst`,(select `comp_gst_field_mapping`.`taxCode` from `comp_gst_field_mapping` where ((`comp_gst_field_mapping`.`companyID` = `a`.`companyID`) and (`comp_gst_field_mapping`.`item` = 'B5b')))) > 0) and (`view_gst_tax`.`transDate` between `a`.`startDate` and `a`.`endDate`))) AS `B5b`,(select coalesce(sum(`view_gst_tax`.`amountExcludedTax`),0) from `view_gst_tax` where ((`view_gst_tax`.`companyID` = `a`.`companyID`) and (find_in_set(`view_gst_tax`.`gst`,(select `comp_gst_field_mapping`.`taxCode` from `comp_gst_field_mapping` where ((`comp_gst_field_mapping`.`companyID` = `a`.`companyID`) and (`comp_gst_field_mapping`.`item` = 'B6a')))) > 0) and (`view_gst_tax`.`transDate` between `a`.`startDate` and `a`.`endDate`))) AS `B6a`,(select coalesce(sum(`view_gst_tax`.`taxAmount`),0) from `view_gst_tax` where ((`view_gst_tax`.`companyID` = `a`.`companyID`) and (find_in_set(`view_gst_tax`.`gst`,(select `comp_gst_field_mapping`.`taxCode` from `comp_gst_field_mapping` where ((`comp_gst_field_mapping`.`companyID` = `a`.`companyID`) and (`comp_gst_field_mapping`.`item` = 'B6b')))) > 0) 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 (find_in_set(`view_gst_tax`.`gst`,(select `comp_gst_field_mapping`.`taxCode` from `comp_gst_field_mapping` where ((`comp_gst_field_mapping`.`companyID` = `a`.`companyID`) and (`comp_gst_field_mapping`.`item` = 'B5b')))) > 0) 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 (find_in_set(`view_gst_tax`.`gst`,(select `comp_gst_field_mapping`.`taxCode` from `comp_gst_field_mapping` where ((`comp_gst_field_mapping`.`companyID` = `a`.`companyID`) and (`comp_gst_field_mapping`.`item` = 'B6b')))) > 0) 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 (find_in_set(`view_gst_tax`.`gst`,(select `comp_gst_field_mapping`.`taxCode` from `comp_gst_field_mapping` where ((`comp_gst_field_mapping`.`companyID` = `a`.`companyID`) and (`comp_gst_field_mapping`.`item` = 'B5b')))) > 0) 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 (find_in_set(`view_gst_tax`.`gst`,(select `comp_gst_field_mapping`.`taxCode` from `comp_gst_field_mapping` where ((`comp_gst_field_mapping`.`companyID` = `a`.`companyID`) and (`comp_gst_field_mapping`.`item` = 'B6b')))) > 0) and (`view_gst_tax`.`transDate` between `a`.`startDate` and `a`.`endDate`)))),0) AS `B7`,if(((select sum(`view_gst_tax`.`taxAmount`) from `view_gst_tax` where ((`view_gst_tax`.`companyID` = `a`.`companyID`) and (find_in_set(`view_gst_tax`.`gst`,(select `comp_gst_field_mapping`.`taxCode` from `comp_gst_field_mapping` where ((`comp_gst_field_mapping`.`companyID` = `a`.`companyID`) and (`comp_gst_field_mapping`.`item` = 'B6b')))) > 0) and (`view_gst_tax`.`transDate` between `a`.`startDate` and `a`.`endDate`))) > (select sum(`view_gst_tax`.`taxAmount`) from `view_gst_tax` where ((`view_gst_tax`.`companyID` = `a`.`companyID`) and (find_in_set(`view_gst_tax`.`gst`,(select `comp_gst_field_mapping`.`taxCode` from `comp_gst_field_mapping` where ((`comp_gst_field_mapping`.`companyID` = `a`.`companyID`) and (`comp_gst_field_mapping`.`item` = 'B5b')))) > 0) and (`view_gst_tax`.`transDate` between `a`.`startDate` and `a`.`endDate`)))),((select sum(`view_gst_tax`.`taxAmount`) from `view_gst_tax` where ((`view_gst_tax`.`companyID` = `a`.`companyID`) and (find_in_set(`view_gst_tax`.`gst`,(select `comp_gst_field_mapping`.`taxCode` from `comp_gst_field_mapping` where ((`comp_gst_field_mapping`.`companyID` = `a`.`companyID`) and (`comp_gst_field_mapping`.`item` = 'B6b')))) > 0) and (`view_gst_tax`.`transDate` between `a`.`startDate` and `a`.`endDate`))) - (select sum(`view_gst_tax`.`taxAmount`) from `view_gst_tax` where ((`view_gst_tax`.`companyID` = `a`.`companyID`) and (find_in_set(`view_gst_tax`.`gst`,(select `comp_gst_field_mapping`.`taxCode` from `comp_gst_field_mapping` where ((`comp_gst_field_mapping`.`companyID` = `a`.`companyID`) and (`comp_gst_field_mapping`.`item` = 'B5b')))) > 0) 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 (find_in_set(`view_gst_tax`.`gst`,(select `comp_gst_field_mapping`.`taxCode` from `comp_gst_field_mapping` where ((`comp_gst_field_mapping`.`companyID` = `a`.`companyID`) and (`comp_gst_field_mapping`.`item` = 'C10')))) > 0) 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 (find_in_set(`view_gst_tax`.`gst`,(select `comp_gst_field_mapping`.`taxCode` from `comp_gst_field_mapping` where ((`comp_gst_field_mapping`.`companyID` = `a`.`companyID`) and (`comp_gst_field_mapping`.`item` = 'C11')))) > 0) 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 (find_in_set(`view_gst_tax`.`gst`,(select `comp_gst_field_mapping`.`taxCode` from `comp_gst_field_mapping` where ((`comp_gst_field_mapping`.`companyID` = `a`.`companyID`) and (`comp_gst_field_mapping`.`item` = 'C12')))) > 0) 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 (find_in_set(`view_gst_tax`.`gst`,(select `comp_gst_field_mapping`.`taxCode` from `comp_gst_field_mapping` where ((`comp_gst_field_mapping`.`companyID` = `a`.`companyID`) and (`comp_gst_field_mapping`.`item` = 'C13')))) > 0) 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 (find_in_set(`view_gst_tax`.`gst`,(select `comp_gst_field_mapping`.`taxCode` from `comp_gst_field_mapping` where ((`comp_gst_field_mapping`.`companyID` = `a`.`companyID`) and (`comp_gst_field_mapping`.`item` = 'C15')))) > 0) 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 (find_in_set(`view_gst_tax`.`gst`,(select `comp_gst_field_mapping`.`taxCode` from `comp_gst_field_mapping` where ((`comp_gst_field_mapping`.`companyID` = `a`.`companyID`) and (`comp_gst_field_mapping`.`item` = 'C16')))) > 0) 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 TABLE IF EXISTS `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 TABLE IF EXISTS `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 TABLE IF EXISTS `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) and (substr(`ri`.`journalNo`,1,2) <> 'AR')) union 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`.`customerName` 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 `customer` `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) and (substr(`ri`.`journalNo`,1,2) = 'AR')) 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 TABLE IF EXISTS `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`,`d`.`name`,`b`.`description` */;

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

/*!50001 DROP TABLE IF EXISTS `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`,`c`.`inventoriesID`,`d`.`code`,`e`.`code` */;

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

/*!50001 DROP TABLE IF EXISTS `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`,`i`.`itemTypeID` AS `itemTypeID` from ((`comp_receive_item` `a` left join `comp_receive_item_detail` `b` on(((`a`.`ID` = `b`.`receiveID`) and (`b`.`balanceItem` > 0)))) left join `item` `i` on((`i`.`ID` = `b`.`itemID`))) group by `a`.`companyID`,`a`.`locationID`,`b`.`itemID`,`b`.`itemCode`,`b`.`itemName`,`b`.`umID` union select `a`.`companyID` AS `companyID`,`b`.`fldid` AS `locationID`,`a`.`ID` AS `itemID`,`a`.`itemCode` AS `itemCode`,`a`.`name` AS `itemName`,`a`.`unitOfMeasureID` AS `umID`,1 AS `quantityOnHand`,`a`.`itemTypeID` AS `itemTypeID` from (`item` `a` join `tbl_location` `b`) where ((`a`.`itemTypeID` = 23) and (`a`.`companyID` = `b`.`companyID`)) */;

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

/*!50001 DROP TABLE IF EXISTS `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`,`i`.`itemTypeID` AS `itemTypeID` from ((`comp_receive_item` `a` left join `comp_receive_item_detail` `b` on(((`a`.`ID` = `b`.`receiveID`) and (`b`.`balanceItem` > 0)))) left join `item` `i` on((`i`.`ID` = `b`.`itemID`))) where (`a`.`updateAble` = 0) group by `a`.`companyID`,`a`.`locationID`,`b`.`itemID`,`b`.`itemCode`,`b`.`itemName`,`b`.`umID` union select `a`.`companyID` AS `companyID`,`b`.`fldid` AS `locationID`,`a`.`ID` AS `itemID`,`a`.`itemCode` AS `itemCode`,`a`.`name` AS `itemName`,`a`.`unitOfMeasureID` AS `umID`,1 AS `quantityOnHand`,`a`.`itemTypeID` AS `itemTypeID` from (`item` `a` join `tbl_location` `b`) where ((`a`.`itemTypeID` = 23) and (`a`.`companyID` = `b`.`companyID`)) */;

--
-- Final view structure for view `view_journal_no_acctcode`
--

/*!50001 DROP TABLE IF EXISTS `view_journal_no_acctcode`*/;
/*!50001 DROP VIEW IF EXISTS `view_journal_no_acctcode`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_journal_no_acctcode` AS select `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,`a`.`journalID` AS `journalID`,`a`.`sequence` AS `sequence`,`a`.`acctCode` AS `acctCode`,`a`.`projectID` AS `projectID`,`a`.`description` AS `description`,`a`.`amount_cr` AS `amount_cr`,`a`.`amount_dr` AS `amount_dr`,`a`.`currencyID` AS `currencyID`,`a`.`currency_amount` AS `currency_amount`,`a`.`exchange_rate` AS `exchange_rate`,`a`.`enter_exchange_rate` AS `enter_exchange_rate`,`a`.`period` AS `period`,`a`.`year` AS `year`,`a`.`formNo` AS `formNo`,`a`.`supplier` AS `supplier`,`a`.`line` AS `line`,`a`.`status` AS `status`,`a`.`createdBy` AS `createdBy`,`a`.`createdTS` AS `createdTS`,`a`.`updatedBy` AS `updatedBy`,`a`.`updatedTS` AS `updatedTS`,`a`.`is_delete` AS `is_delete`,`a`.`bankReconcileID` AS `bankReconcileID` from `comp_journal_detail` `a` where ((`a`.`is_delete` = 0) and (isnull(`a`.`acctCode`) or (`a`.`acctCode` = 0) or (not(`a`.`acctCode` in (select `comp_chart_of_acct`.`ID` from `comp_chart_of_acct` where (`comp_chart_of_acct`.`companyID` = `a`.`companyID`)))))) */;

--
-- Final view structure for view `view_journal_no_detail`
--

/*!50001 DROP TABLE IF EXISTS `view_journal_no_detail`*/;
/*!50001 DROP VIEW IF EXISTS `view_journal_no_detail`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_journal_no_detail` AS select `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,`a`.`journalID` AS `journalID`,`a`.`description` AS `description`,`a`.`referrence` AS `referrence`,`a`.`batch` AS `batch`,`a`.`module` AS `module`,`a`.`effective_date` AS `effective_date`,`a`.`entered_date` AS `entered_date`,`a`.`period` AS `period`,`a`.`year` AS `year`,`a`.`total_amount_dr` AS `total_amount_dr`,`a`.`total_amount_cr` AS `total_amount_cr`,`a`.`total_amount` AS `total_amount`,`a`.`status` AS `status`,`a`.`remarks` AS `remarks`,`a`.`createdBy` AS `createdBy`,`a`.`createdTS` AS `createdTS`,`a`.`formNo` AS `formNo`,`a`.`is_delete` AS `is_delete` from `comp_journal` `a` where (not(`a`.`journalID` in (select `comp_journal_detail`.`journalID` from `comp_journal_detail` where ((`comp_journal_detail`.`companyID` = `a`.`companyID`) and (`comp_journal_detail`.`journalID` = `a`.`journalID`))))) */;

--
-- Final view structure for view `view_journal_no_transaction`
--

/*!50001 DROP TABLE IF EXISTS `view_journal_no_transaction`*/;
/*!50001 DROP VIEW IF EXISTS `view_journal_no_transaction`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_journal_no_transaction` AS select `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,`a`.`journalID` AS `journalID`,`a`.`sequence` AS `sequence`,`a`.`acctCode` AS `acctCode`,`a`.`projectID` AS `projectID`,`a`.`description` AS `description`,`a`.`amount_cr` AS `amount_cr`,`a`.`amount_dr` AS `amount_dr`,`a`.`currencyID` AS `currencyID`,`a`.`currency_amount` AS `currency_amount`,`a`.`exchange_rate` AS `exchange_rate`,`a`.`enter_exchange_rate` AS `enter_exchange_rate`,`a`.`period` AS `period`,`a`.`year` AS `year`,`a`.`formNo` AS `formNo`,`a`.`supplier` AS `supplier`,`a`.`line` AS `line`,`a`.`status` AS `status`,`a`.`createdBy` AS `createdBy`,`a`.`createdTS` AS `createdTS`,`a`.`updatedBy` AS `updatedBy`,`a`.`updatedTS` AS `updatedTS`,`a`.`is_delete` AS `is_delete`,`a`.`bankReconcileID` AS `bankReconcileID` from `comp_journal_detail` `a` where ((not(`a`.`journalID` in (select distinct `view_journal_table`.`journalID` from `view_journal_table` where (`view_journal_table`.`companyID` = `a`.`companyID`)))) and (`a`.`is_delete` = 0) and (substr(`a`.`journalID`,1,2) not in ('JL','GT'))) */;

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

/*!50001 DROP TABLE IF EXISTS `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) and (`a`.`companyID` = `b`.`companyID`)) union select distinct `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,`a`.`referenceNo` AS `referenceNo`,'comp_payment' AS `tableName`,`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) and (`a`.`companyID` = `b`.`companyID`)) union select distinct `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,`a`.`referenceNo` AS `referenceNo`,'comp_payment_others' AS `tableName`,`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) and (`a`.`companyID` = `b`.`companyID`)) union select distinct `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,`a`.`formNo` AS `referenceNo`,'comp_purchase_order' AS `tableName`,`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) and (`a`.`companyID` = `b`.`companyID`)) union select distinct `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,`a`.`referenceNo` AS `referenceNo`,'comp_receive_payment' AS `tableName`,`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) and (`a`.`companyID` = `b`.`companyID`)) union select distinct `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,`a`.`referenceNo` AS `referenceNo`,'comp_receive_payment_others' AS `tableName`,`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) and (`a`.`companyID` = `b`.`companyID`)) union select distinct `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,`b`.`formNo` AS `referenceNo`,'comp_sales_creditnote' AS `tableName`,`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) and (`a`.`companyID` = `b`.`companyID`)) union select distinct `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,`b`.`formNo` AS `referenceNo`,'comp_sales_debitnote' AS `tableName`,`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) and (`a`.`companyID` = `b`.`companyID`)) union select distinct `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,`a`.`customerPoNo` AS `referenceNo`,'comp_sales_invoice' AS `tableName`,`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) and (`a`.`companyID` = `b`.`companyID`)) union select distinct `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,`b`.`formNo` AS `referenceNo`,'comp_supplier_creditnote' AS `tableName`,`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) and (`a`.`companyID` = `b`.`companyID`)) union select distinct `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,`b`.`formNo` AS `referenceNo`,'comp_supplier_debitnote' AS `tableName`,`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) and (`a`.`companyID` = `b`.`companyID`)) union select distinct `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,`a`.`supplierInvoiceNo` AS `referenceNo`,'comp_supplier_invoice' AS `tableName`,`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) and (`a`.`companyID` = `b`.`companyID`)) union select distinct `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,`b`.`formNo` AS `referenceNo`,'comp_delivery_order' AS `tableName`,`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`) and (`a`.`companyID` = `b`.`companyID`)) union select distinct `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,`a`.`reference` AS `referenceNo`,'comp_gst_transaction' AS `tableName`,`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`) and (`a`.`companyID` = `b`.`companyID`)) union select distinct `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,`a`.`supplierDoNo` AS `referenceNo`,'comp_receive_item' AS `tableName`,`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`) and (`a`.`companyID` = `b`.`companyID`) and (`a`.`isDelete` = 0) and (`a`.`purchaseOrderID` >= 0)) union select distinct `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,`c`.`name` AS `referenceNo`,'zakat_summary' AS `tableName`,`b`.`journalID` AS `journalID`,`b`.`formNo` AS `formNo` from ((`zakat_summary` `a` join `comp_journal` `b`) join `zakat_center` `c`) where ((convert(`a`.`journalNo` using utf8) = `b`.`journalID`) and (`a`.`centerID` = `c`.`ID`) and (`a`.`companyID` = `b`.`companyID`)) */;

--
-- Final view structure for view `view_journal_total_dr_cr_different`
--

/*!50001 DROP TABLE IF EXISTS `view_journal_total_dr_cr_different`*/;
/*!50001 DROP VIEW IF EXISTS `view_journal_total_dr_cr_different`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_journal_total_dr_cr_different` AS select `a`.`companyID` AS `companyid`,`b`.`year` AS `year`,`b`.`period` AS `period`,format(sum(`a`.`amount_dr`),2) AS `format(sum(``a``.``amount_dr``),2)`,format(sum(`a`.`amount_cr`),2) AS `format(sum(``a``.``amount_cr``),2)` from (`comp_journal_detail` `a` join `comp_journal` `b`) where ((`a`.`companyID` = `b`.`companyID`) and (`a`.`journalID` = `b`.`journalID`)) group by `a`.`companyID`,`b`.`year`,`b`.`period` having (format(sum(`a`.`amount_dr`),2) <> format(sum(`a`.`amount_cr`),2)) */;

--
-- Final view structure for view `view_journal_total_header_detail_different`
--

/*!50001 DROP TABLE IF EXISTS `view_journal_total_header_detail_different`*/;
/*!50001 DROP VIEW IF EXISTS `view_journal_total_header_detail_different`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_journal_total_header_detail_different` AS select `a`.`companyID` AS `companyid`,`a`.`year` AS `year`,`a`.`period` AS `period`,`a`.`journalID` AS `journalid`,`a`.`total_amount_dr` AS `total_amount_dr`,`a`.`total_amount_cr` AS `total_amount_cr`,format(sum(`b`.`amount_dr`),2) AS `format(sum(``b``.``amount_dr``),2)`,format(sum(`b`.`amount_cr`),2) AS `format(sum(``b``.``amount_cr``),2)` from (`comp_journal` `a` join `comp_journal_detail` `b`) where ((`a`.`companyID` = `b`.`companyID`) and (`a`.`journalID` = `b`.`journalID`) and (`a`.`status` = 1) and (`a`.`is_delete` = 0)) group by `a`.`companyID`,`a`.`journalID` having ((format(`a`.`total_amount_dr`,2) <> format(sum(`b`.`amount_dr`),2)) or (format(`a`.`total_amount_cr`,2) <> format(sum(`b`.`amount_cr`),2))) */;

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

/*!50001 DROP TABLE IF EXISTS `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 TABLE IF EXISTS `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 TABLE IF EXISTS `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 TABLE IF EXISTS `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`) union select `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,concat('glreports/otherReceiveAdviceRpt/',`a`.`ID`) AS `searchLink`,concat('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`.`receivePaymentDate`,'%d/%m/%Y') using latin1),'&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',`b`.`description`) AS `searchKey`,`a`.`receivePaymentDate` AS `transDate` from (`comp_receive_payment_others` `a` join `comp_receive_payment_others_detail` `b`) where (`a`.`ID` = `b`.`receivePaymentOthersID`) union select `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,concat('othersPayment/otherpaywithoutDetail/',`a`.`ID`) AS `searchLink`,concat('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`.`paymentDate`,'%d/%m/%Y') using latin1),'&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',`b`.`itemdescription`) AS `searchKey`,`a`.`paymentDate` AS `transDate` from (`comp_payment_others` `a` join `comp_payment_others_without_item` `b`) where (`a`.`ID` = `b`.`otherPaymentID`) */;

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

/*!50001 DROP TABLE IF EXISTS `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 TABLE IF EXISTS `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 TABLE IF EXISTS `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 TABLE IF EXISTS `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 TABLE IF EXISTS `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 TABLE IF EXISTS `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 TABLE IF EXISTS `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 TABLE IF EXISTS `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 TABLE IF EXISTS `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 TABLE IF EXISTS `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 TABLE IF EXISTS `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 TABLE IF EXISTS `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 TABLE IF EXISTS `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 TABLE IF EXISTS `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 TABLE IF EXISTS `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 TABLE IF EXISTS `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 TABLE IF EXISTS `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 TABLE IF EXISTS `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 TABLE IF EXISTS `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 TABLE IF EXISTS `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_serial_zakat`
--

/*!50001 DROP TABLE IF EXISTS `view_serial_zakat`*/;
/*!50001 DROP VIEW IF EXISTS `view_serial_zakat`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_serial_zakat` AS select `c`.`ID` AS `companyID`,ifnull(((select max(`t`.`serialNo`) from `zakat_summary` `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_summary_debit_credit`
--

/*!50001 DROP TABLE IF EXISTS `view_summary_debit_credit`*/;
/*!50001 DROP VIEW IF EXISTS `view_summary_debit_credit`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_summary_debit_credit` AS select distinct `comp_journal_detail`.`companyID` AS `companyid`,`comp_journal_detail`.`acctCode` AS `acctCode`,`comp_journal_detail`.`year` AS `year`,`comp_journal_detail`.`period` AS `period`,coalesce(sum(`comp_journal_detail`.`amount_dr`),0) AS `total_dr`,coalesce(sum(`comp_journal_detail`.`amount_cr`),0) AS `total_cr` from `comp_journal_detail` where (`comp_journal_detail`.`is_delete` = 0) group by `comp_journal_detail`.`companyID`,`comp_journal_detail`.`acctCode`,`comp_journal_detail`.`year`,`comp_journal_detail`.`period` */;

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

/*!50001 DROP TABLE IF EXISTS `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`,`a`.`supplierName` AS `supplierName`,`a`.`phoneNumber1` AS `phoneNumber1`,`a`.`email` AS `email`,((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 TABLE IF EXISTS `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 TABLE IF EXISTS `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 TABLE IF EXISTS `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 TABLE IF EXISTS `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 TABLE IF EXISTS `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 TABLE IF EXISTS `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 TABLE IF EXISTS `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 TABLE IF EXISTS `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 TABLE IF EXISTS `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 TABLE IF EXISTS `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`,date_format(`comp_purchase_order`.`poDate`,'%Y') 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`,date_format(`comp_receive_item`.`deliveryDate`,'%Y') 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`,date_format(`comp_supplier_invoice`.`invoiceDate`,'%Y') 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`,date_format(`comp_supplier_debitnote`.`debitNoteDate`,'%Y') 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`,date_format(`comp_supplier_creditnote`.`creditNoteDate`,'%Y') 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`,date_format(`comp_payment`.`paymentDate`,'%Y') 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`,date_format(`comp_payment_others`.`paymentDate`,'%Y') 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`,date_format(`comp_payment_others`.`paymentDate`,'%Y') 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`,date_format(`comp_sales_order`.`salesOrderDate`,'%Y') 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`,date_format(`comp_delivery_order`.`deliveryOrderDate`,'%Y') 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`,date_format(`comp_sales_invoice`.`salesInvoiceDate`,'%Y') 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`,date_format(`comp_sales_debitnote`.`debitNoteDate`,'%Y') 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`,date_format(`comp_sales_creditnote`.`creditNoteDate`,'%Y') 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`,date_format(`comp_receive_payment`.`receivePaymentDate`,'%Y') 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`,date_format(`comp_receive_payment_others`.`receivePaymentDate`,'%Y') 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`,date_format(`comp_cash_sales`.`salesInvoiceDate`,'%Y') 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 TABLE IF EXISTS `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`,if((`d`.`itemTypeID` = 23),ifnull(`d`.`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` = 'cogs')))),(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 TABLE IF EXISTS `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`,if((`d`.`itemTypeID` = 23),ifnull(`d`.`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` = 'cogs')))),(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 TABLE IF EXISTS `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`,if((`c`.`itemTypeID` = 23),ifnull(`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` = 'cogs')))),(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` join `comp_supplier_invoice_detail` `b` on((`a`.`ID` = `b`.`invoiceID`))) left join `item` `c` on((`b`.`itemID` = `c`.`ID`))) left 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 TABLE IF EXISTS `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`,if((`d`.`itemTypeID` = 22),(select `item`.`cogsID` from `item` where (`item`.`ID` = `b`.`itemID`)),NULL) AS `cogsAcctID`,if((`d`.`itemTypeID` = 22),(select `item`.`inventoriesID` from `item` where (`item`.`ID` = `b`.`itemID`)),NULL) 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 TABLE IF EXISTS `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`,if((`d`.`itemTypeID` = 22),`d`.`cogsID`,NULL) AS `cogsAcctID`,if((`d`.`itemTypeID` = 22),`d`.`inventoriesID`,NULL) 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 TABLE IF EXISTS `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) and (`c`.`itemTypeID` = 22)) 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 TABLE IF EXISTS `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)) 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`.`debitnoteID` 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_debitnote` `b` left join `comp_sales_debitnote` `d` on((`d`.`ID` = `b`.`debitnoteID`)))) join `comp_sales_debitnote` `c`) join `customer` `e`) where ((`a`.`customerID` = `e`.`ID`) and (`a`.`ID` = `b`.`paymentID`) and (`c`.`ID` = `b`.`debitnoteID`) and (`a`.`updateAble` = 1) and (`a`.`is_delete` = 0)) */;

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

/*!50001 DROP TABLE IF EXISTS `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 TABLE IF EXISTS `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 TABLE IF EXISTS `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) and (`c`.`itemTypeID` <> 23)) */;

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

/*!50001 DROP TABLE IF EXISTS `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 TABLE IF EXISTS `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)) union 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) and (`a`.`simplifiedTax` = 1) and ((select coalesce(sum(`comp_payment_others_without_item`.`taxAmount`),0) from `comp_payment_others_without_item` where ((`comp_payment_others_without_item`.`otherPaymentID` = `a`.`ID`) and (`comp_payment_others_without_item`.`lineNo` <= `b`.`lineNo`))) <= (select `c`.`MaxInputTaxClaim` from `comp_gst_preference` `c` where (`c`.`companyID` = `a`.`companyID`)))) union 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`,((select `c`.`MaxInputTaxClaim` from `comp_gst_preference` `c` where (`c`.`companyID` = `a`.`companyID`)) - (select coalesce(sum(`comp_payment_others_without_item`.`taxAmount`),0) from `comp_payment_others_without_item` where ((`comp_payment_others_without_item`.`otherPaymentID` = `a`.`ID`) and (`comp_payment_others_without_item`.`lineNo` < `b`.`lineNo`)))) 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) and (`a`.`simplifiedTax` = 1) and ((select coalesce(sum(`comp_payment_others_without_item`.`taxAmount`),0) from `comp_payment_others_without_item` where ((`comp_payment_others_without_item`.`otherPaymentID` = `a`.`ID`) and (`comp_payment_others_without_item`.`lineNo` <= `b`.`lineNo`))) > (select `c`.`MaxInputTaxClaim` from `comp_gst_preference` `c` where (`c`.`companyID` = `a`.`companyID`))) and ((select coalesce(sum(`comp_payment_others_without_item`.`taxAmount`),0) from `comp_payment_others_without_item` where ((`comp_payment_others_without_item`.`otherPaymentID` = `a`.`ID`) and (`comp_payment_others_without_item`.`lineNo` < `b`.`lineNo`))) < (select `c`.`MaxInputTaxClaim` from `comp_gst_preference` `c` where (`c`.`companyID` = `a`.`companyID`)))) union 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`,(select (coalesce(sum(`comp_payment_others_without_item`.`taxAmount`),0) - (select `c`.`MaxInputTaxClaim` from `comp_gst_preference` `c` where (`c`.`companyID` = `a`.`companyID`))) from `comp_payment_others_without_item` where ((`comp_payment_others_without_item`.`otherPaymentID` = `a`.`ID`) and (`comp_payment_others_without_item`.`lineNo` <= `b`.`lineNo`))) AS `taxamount`,`b`.`accountID` AS `drAccountID`,(select `comp_bank`.`linkAccountID` from `comp_bank` where (`comp_bank`.`ID` = `a`.`bankId`)) 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` = 'gstnoclaim'))) 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) and (`a`.`simplifiedTax` = 1) and ((select coalesce(sum(`comp_payment_others_without_item`.`taxAmount`),0) from `comp_payment_others_without_item` where ((`comp_payment_others_without_item`.`otherPaymentID` = `a`.`ID`) and (`comp_payment_others_without_item`.`lineNo` <= `b`.`lineNo`))) > (select `c`.`MaxInputTaxClaim` from `comp_gst_preference` `c` where (`c`.`companyID` = `a`.`companyID`))) and ((select coalesce(sum(`comp_payment_others_without_item`.`taxAmount`),0) from `comp_payment_others_without_item` where ((`comp_payment_others_without_item`.`otherPaymentID` = `a`.`ID`) and (`comp_payment_others_without_item`.`lineNo` < `b`.`lineNo`))) < (select `c`.`MaxInputTaxClaim` from `comp_gst_preference` `c` where (`c`.`companyID` = `a`.`companyID`)))) union 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`,(select (coalesce(sum(`comp_payment_others_without_item`.`taxAmount`),0) - (select `c`.`MaxInputTaxClaim` from `comp_gst_preference` `c` where (`c`.`companyID` = `a`.`companyID`))) from `comp_payment_others_without_item` where ((`comp_payment_others_without_item`.`otherPaymentID` = `a`.`ID`) and (`comp_payment_others_without_item`.`lineNo` <= `b`.`lineNo`))) AS `taxamount`,`b`.`accountID` AS `drAccountID`,(select `comp_bank`.`linkAccountID` from `comp_bank` where (`comp_bank`.`ID` = `a`.`bankId`)) 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` = 'gstnoclaim'))) 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) and (`a`.`simplifiedTax` = 1) and ((select coalesce(sum(`comp_payment_others_without_item`.`taxAmount`),0) from `comp_payment_others_without_item` where ((`comp_payment_others_without_item`.`otherPaymentID` = `a`.`ID`) and (`comp_payment_others_without_item`.`lineNo` <= (`b`.`lineNo` + 1)))) > (select `c`.`MaxInputTaxClaim` from `comp_gst_preference` `c` where (`c`.`companyID` = `a`.`companyID`)))) */;

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

/*!50001 DROP TABLE IF EXISTS `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`,`b`.`lineNo` AS `lineNo`,`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 TABLE IF EXISTS `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 TABLE IF EXISTS `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`) and (`c`.`itemTypeID` <> 23)) */;

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

/*!50001 DROP TABLE IF EXISTS `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 TABLE IF EXISTS `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`,`c`.`ID` */;


