
CREATE TABLE IF NOT EXISTS `master` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(64) NOT NULL,
  `description` varchar(128) NOT NULL,
  `createdby` int(11) NOT NULL,
  `createdTS` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updatedby` int(11) NOT NULL,
  `updatedTS` timestamp NOT NULL ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB  ;

--
-- Dumping data for table `master`
--

INSERT INTO `master` (`ID`, `name`, `description`, `createdby`) VALUES
(1, 'Status', 'status active or inactive', 1),
(2, 'Shipping Method', '', 1),
(3, 'State', 'State', 1),
(4, 'Module', 'Application module', 1),
(5, 'Gender', 'Gender Male or Female', 1),
(6, 'Bank', 'List of bank', 1),
(7, 'Payment Method', 'List of payment method', 1),
(8, 'Item Category', 'List of item category', 1),
(9, 'Item Type', 'List of item type - product or service', 1),
(10, 'Language', 'Language selection English or Bahasa Malasyia', 1),
(11, 'Accounting Method', 'Accounting Closing/Opening method monthly or yearly', 1),
(12, 'Unit of Measure', 'Unit of measurement such as kg, feet, meter, cubic', 1),
(13, 'Account Type', 'Account type for chart of accounts', 1),
(14, 'Business Type', 'Business type based on industry selected', 1),
(15, 'Industry', 'List of industry classification - retail, manufacturing, service, others', 1),
(16, 'Invoice Purchase Code', '', 1),
(17, 'Invoice Sales Code', '', 1),
(18, 'System Form', '', 1),
(19, 'Address', 'List of Address', 1),
(20, 'Movement Type', 'List of inventory movement type', 1),
(21, 'General Setup', 'General Setup Parameters', 1);

//(18, 'System Form', '', 1),

CREATE TABLE IF NOT EXISTS `master_code` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `masterID` int(11) NOT NULL,
  `parentFilterID` int(11) DEFAULT NULL,
  `code` varchar(4) NOT NULL,
  `name` varchar(64) NOT NULL,
  `shortName` varchar(8) NOT NULL,
  `description` varchar(128) NOT NULL,
  `orderNo` 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 ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB  ;

--
-- Dumping data for table `master_code`
--

INSERT INTO `master_code` (`ID`, `masterID`, `parentFilterID`, `code`, `name`, `shortName`, `description`, `orderNo`, `createdBy`) VALUES
(1, 1, NULL, '0', 'Active', 'Active', '', 1, 0 ),
(2, 1, NULL, '1', 'Inactive', 'Inactive', '', 2, 0),
(3, 2, NULL, 'FR', 'Freight', 'Freight', '', 1, 0),
(4, 2, NULL, 'FE', 'FedEx', 'FE', '', 2, 0),
(5, 2, NULL, 'UPS', 'UPS', 'UPS', '', 3, 0),
(6, 2, NULL, 'CLNK', 'CityLink', 'CLNK', '', 2, 0),
(7, 2, NULL, 'PL', 'Pos Laju', 'PL', '', 5, 0),
(8, 2, NULL, 'DHL', 'DHL', 'DHL', '', 4, 0),
(9, 5, NULL, 'M', 'Male', 'Male', '', 1, 0),
(10, 5, NULL, 'F', 'Female', '', '', 2, 0),
(11, 15, NULL, 'MFC', 'Manufacturing', 'MFC', '', 1, 0),
(12, 15, NULL, 'RT', 'Retail', 'RT', '', 2, 0),
(13, 15, NULL, 'SERV', 'Service', 'SERV', '', 3, 0),
(14, 15, NULL, 'OTH', 'Others', 'OTH', '', 4, 0),
(15, 10, NULL, 'ENG', 'English', 'ENG', '', 1, 0),
(16, 10, NULL, 'BM', 'Bahasa Malaysia', 'BM', '', 2, 0),
(17, 11, NULL, 'MTH', 'Monthly', 'MTH', '', 0, 0),
(18, 11, NULL, 'YR', 'Yearly', 'YR', '', 0, 0),
(19, 8, NULL, 'E', 'Electrical Appliance', 'EA', '', 5, 1),
(20, 8, NULL, 'S', 'Stationary', 'ST', '', 10, 1),
(21, 8, NULL, 'I', 'IT', 'IT', '', 15, 1),
(22, 9, 30, 'FC', 'Chair', 'Chair', '', 1, 1),
(23, 9, 30, 'FT', 'Table', 'Table', '', 5, 1),
(24, 9, 19, 'EF', 'Fans', 'Fans', '', 10, 1),
(25, 9, 19, 'EA', 'Aircondition', 'Air-cond', '', 15, 1),
(26, 9, 20, 'SC', 'Calculator', 'CALC', '', 15, 1),
(27, 9, 20, 'SP', 'Printing Paper', 'Paper', '', 15, 1),
(28, 9, 21, 'IP', 'Printer', 'Printer', '', 15, 1),
(29, 9, 21, 'II', 'Printer toner', 'toner', '', 15, 1),
(30, 8, NULL, 'F', 'Furniture', 'FR', '', 1, 1),
(31, 16, NULL, '1', 'Purchase Invoice', '', '', 10, 1),
(32, 16, NULL, '2', 'Direct Purchase Invcoice', '', '', 20, 1),
(33, 16, NULL, '3', 'Debit Note', '', 'Purchase Invoice Debit Note (Adjustment)', 30, 1),
(34, 16, NULL, '4', 'Credit Note', '', 'Purchase Invoice Credit Note (Adjustment)', 40, 1),
(35, 17, NULL, '1', 'Sales Invoice', '', '', 50, 1),
(36, 17, NULL, '2', 'Direct Sales Invcoice', '', '', 60, 1),
(37, 17, NULL, '3', 'Debit Note', '', 'Sales Invoice Debit Note (Adjustment)', 70, 1),
(38, 17, NULL, '4', 'Credit Note', '', 'Sales Invoice Credit Note (Adjustment)', 80, 1),

(39, 18, NULL, 'PR', 'Purchase Request', 'PR', 'Purchase Request Form', 90, 1),
(40, 18, NULL, 'PO', 'Purchase Order', 'PO', 'Purchase Order Form', 100, 1),
(41, 18, NULL, 'PINV', 'Purchase Invoice', 'PURINV', 'Form Purchase Invoice', 110, 1),
(42, 18, NULL, 'PDN', 'Purchase Debit Note', 'PDN', 'Purchase Debit Note Form', 120, 1),
(43, 18, NULL, 'PCN', 'Purchase Credit Note', 'PCN', 'Purchase Credit Note Form', 140, 1),
(44, 18, NULL, 'PP', 'Purchase Payment', 'PP', 'Purchase Payment Form', 150, 1),
(45, 18, NULL, 'GRN', 'Good Received Note', 'PP', 'Godd Received Note Form', 160, 1),
(46, 18, NULL, 'LT', 'Inventory Movement', 'LT', 'Inventory Movement Form', 170, 1),
(47, 18, NULL, 'SQN', 'Sales Quotation', 'SQN', 'Sales Quotation Form', 180, 1),
(48, 18, NULL, 'SON', 'Sales Order', 'SON', 'Sales Order Form', 190, 1),
(49, 18, NULL, 'SDN', 'Delivery Order', 'SDN', 'Delivery Order Form', 200, 1),
(50, 18, NULL, 'INV', 'Invoice', 'INV', 'Invoice Form', 210, 1),
(51, 18, NULL, 'SDN', 'Sales Debit Note', 'PDN', 'Sales Debit Note Form', 230, 1),
(52, 18, NULL, 'SCN', 'Sales Credit Note', 'PCN', 'Sales Credit Note Form', 240, 1),
(53, 18, NULL, 'RP', 'Receive Payment', 'RP', 'Receive Payment Form', 250, 1),
(54, 18, NULL, 'GRN', 'General Transaction', 'PP', 'General Transaction Form', 260, 1),

(55, 18, NULL, 'OPN', 'Others Payment', 'OPN', 'Others Payment Form', 270, 1),
(56, 18, NULL, 'ORI', 'Others Receive', 'ORI', 'Others Receive Form', 280, 1),
(57, 18, NULL, 'SLR', 'Sales Return', 'SLR', 'Sales Return Form', 290, 1),
(58, 18, NULL, 'IA', 'Item Adjustment', 'IA', 'Item Adjustment Form', 300, 1),

(59, 12, NULL, 'KG', 'Kilogram', '', '', 10, 1),
(60, 12, NULL, 'G', 'gram', '', '', 20, 1),
(61, 12, NULL, 'l', 'liter', '', '', 30, 1),
(62, 12, NULL, 'Tonne', 'tonne', '', '', 40, 1),
(63, 12, NULL, 'Unit', 'unit', '', '', 50, 1),
(64, 12, NULL, 'ml', 'mili liter', '', '', 60, 1),
(65, 12, NULL, 'm', 'meter', '', '', 70, 1),
(66, 12, NULL, 'cm', 'centimeter', '', '', 80, 1),
(67, 12, NULL, 'cc', 'cubic cm', '', '', 90, 1),
(68,7,NULL,'','Cash', '', '', 10, 1),
(69,7,NULL,'','Cheque', '', '', 10, 1),
(75,19,NULL,'1','Billing Address', '', '', 10, 1),
(76,19,NULL,'2','HQ', '', '', 20, 1),
(77,19,NULL,'3','Ship To', '', '', 30, 1),
(78,20,NULL,'S','Small', 'Small', '', 10, 1),
(79,20,NULL,'B','Bulk', 'Bulk', '', 30, 1),

(80,21,NULL,NULL,'retainedEarnings','','Retained Earnings',10,1),
(81,21,NULL,NULL,'profitlostYear','','Profit/Loss Year',10,1),
(82,21,NULL,NULL,'exchangeVariances','','Exchange Variances Account',10,1),
(83,21,NULL,NULL,'bankchargesAccount','','Bank Charges Account',10,1),

(84,21,NULL,NULL,'rcvacct','','Receivable Account',10,1),
(85,21,NULL,NULL,'saleacct','','Sales Account',10,1),
(86,21,NULL,NULL,'saledisacct','','Sales Discount Account',10,1),
(87,21,NULL,NULL,'promptpaydisacct','','Prompt Payment Discount Account',10,1),
(88,21,NULL,NULL,'commissionexp','','Commission Expense',10,1),
(89,21,NULL,NULL,'commisionpay','','Commission Payable',10,1),

(90,21,NULL,NULL,'payAcct','','Payable Account',10,1),
(91,21,NULL,NULL,'payDisc','','Payable Discount',10,1),
(92,21,NULL,NULL,'freightcharges','','Freight Charges',10,1),
(93,21,NULL,NULL,'exchangediff','','Exchange Difference',10,1),

(94,21,NULL,NULL,'invAcct','','Inventory Account',10,1),
(95,21,NULL,NULL,'cogs','','C.O.G.S Account',10,1),
(96,21,NULL,NULL,'invAdjAcct','','Inventory Adjustment Account',10,1),

(97,21,NULL,NULL,'gstInputTax','','GST-Input Tax',10,1),
(98,21,NULL,NULL,'gstOutTax','','GST-Output Tax',10,1),
(99,21,NULL,NULL,'susgstInTax','','Suspense-GST Input Tax',10,1),
(100,21,NULL,NULL,'susgstOuTax','','Suspense-GST Output Tax',10,1),
(101,21,NULL,NULL,'gstnoclaim','','GST Not Claimable',10,1),
(102,21,NULL,NULL,'imdutypay','','Import Duty Payable',10,1),
(103,21,NULL,NULL,'saletaxpay','','Sale Tax Payable',10,1),
(104,21,NULL,NULL,'servtaxpay','','Service Tax Payable',10,1),

(105,21,NULL,NULL,'zakat','','Zakat Expenses',10,1),
(106,21,NULL,NULL,'uninvoiceAP','','AP-Accrual Inventory',10,1),
(107,21,NULL,NULL,'bank','','Banking Account',35,1),





CREATE TABLE IF NOT EXISTS `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 AUTO_INCREMENT=7 ;


INSERT INTO `wakaf_beneficiaries` (`ID`, `shortName`, `name`, `createdTS`, `createdBy`) VALUES
(1, 'School', 'School/Madrasa',  1),
(2, 'Mosque', 'Masjid/Surau',  1),
(3, 'Hospital', 'Hospital',  1),
(4, 'Orphanage', 'Orphanage',  1),
(5, 'Quran', 'Quran/Books',  1 ),
(6, 'Others', 'Others (please specify)',  1);



CREATE TABLE IF NOT EXISTS `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,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT AUTO_INCREMENT=1 ;

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

INSERT INTO `WAKAF_center` ( `shortName`, `name`, `line1`, `line2`, `line3`, `city`, `postCode`, `stateID`, `countryID`, `noTel`, `noFax`, `email`, `website`,  `createdBy`) VALUES
( 'MAIPS', 'Baitulmal Unit Wakaf, Majlis Agama Islam dan Adat Istiadat 
Melayu Perlis', 'A2, Taman Pengkalan Asam', ', Jalan Kangar- Alor Setar', '', 'Kangar', '01000', idnegeri, idnegara, '04-', '04-', 'email', 'http://www.e-zakat.com.my',  1 ),
( 'MAIKS', 'Bahagian Wakaf, Majlis Agama Islam Negeri Kedah
', 'l1', 'l2', 'l3', 'Alor Setar', '05000', idnegeri, idnegara, '03-', '03-', 'email', 'http://www.e-zakat.com.my',  1 ),
( 'MAINPP', 'Bahagian Wakaf, Majlis Agama Islam Pulau Pinang
', 'l1', 'l2', 'l3', 'city', '10400', idnegeri, idnegara, '03-', '03-', 'email', 'http://www.e-zakat.com.my',  1 ),
( 'MAIAMP', 'Majlis Agama Islam dan Adat Melayu Perak
', 'l1', 'l2', 'l3', 'Ipoh', '3000', idnegeri, idnegara, '03-', '03-', 'email', 'http://www.e-zakat.com.my',  1 ),
( '', 'Perbadanan Wakaf Selangor, Agama Islam Selangor', 'l1', 'l2', 'l3', 'Shah Alam', '40000', idnegeri, idnegara, '03-', '03-', 'email', 'http://www.e-zakat.com.my',  1 ),
( '', 'Bahagian Baitulmal, Majlis Agama Islam Wilayah Persekutuan', 'l1', 'l2', 'l3', 'city', '50676', idnegeri, idnegara, '03-', '03-', 'email', 'http://www.e-zakat.com.my',  1 ),
( '', 'Bahagian Wakaf & Sumbber Am, Baitulmal Majlis Agama Islam 
Melaka', 'l1', 'l2', 'l3', 'Bukit Palah', '75400', idnegeri, idnegara, '03-', '03-', 'email', 'http://www.e-zakat.com.my',  1 ),
( '', 'Pejabat Wakaf, Majlis Agama Islam Negeri Johor', 'l1', 'l2', 'l3', 'Johor Bahru', '80100', idnegeri, idnegara, '03-', '03-', 'email', 'http://www.e-zakat.com.my',  1 ),
( '', 'Majlis Agama Islam dan Adat Istiadat Melayu Kelantan
', 'l1', 'l2', 'l3', 'Kota Bharu', '15200', idnegeri, idnegara, '03-', '03-', 'email', 'http://www.e-zakat.com.my',  1 ),
( '', 'Jabatan Baitulmal, Agama Islam dan Adat Melayu Terengganu
', 'l1', 'l2', 'l3', 'Kuala Terengganu', '20676', idnegeri, idnegara, '03-', '03-', 'email', 'http://www.e-zakat.com.my',  1 ),
( '', 'Unit Wakaf, Baitulmal, Majlis Ugama Islam dan Adat Resam 
Melayu Pahang
', 'l1', 'l2', 'l3', 'Pekan', '26600', idnegeri, idnegara, '03-', '03-', 'email', 'http://www.e-zakat.com.my',  1 ),
( '', 'Tabung Baitulmal, Islam Sarawak
', 'l1', 'l2', 'l3', 'Kuching', '93400', idnegeri, idnegara, '03-', '03-', 'email', 'http://www.e-zakat.com.my',  1 ),
( '', 'Perbadanan Baitulmal Negeri Sabah, Ugama Islam Sabah', 'l1', 'l2', 'l3', 'Kota Kinabalu', '88818', idnegeri, idnegara, '03-', '03-', 'email', 'http://www.e-zakat.com.my',  1 ),
( '', 'Yayasan Wakaf Malaysia', 'l1', 'l2', 'l3', 'Putrajaya', '62050', idnegeri, idnegara, '03-', '03-', 'email', 'http://www.e-zakat.com.my',  1 )