-- Table structure for table `comp_payment_others_with_item`
--

CREATE TABLE IF NOT EXISTS `comp_payment_others_with_item` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `otherPaymentID` int(11) NOT NULL,
  `lineNo` int(11) NOT NULL,
  `itemID` int(11) NOT NULL,
  `itemname` varchar(64) NOT NULL,
  `itemdescription` text NOT NULL,
  `quantity` int(11) NOT NULL,
  `unitPrice` double NOT NULL,
  `amountExcludedTax` double NOT NULL,
  `taxID` int(11) NOT NULL,
  `taxRate` double NOT NULL,
  `taxAmount` double NOT NULL,
  `amountIncludedTax` double NOT NULL,
  `accountID` int(11) NOT NULL,
  `createdBy` int(11) NOT NULL,
  `createdTS` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `updatedBy` int(11) NOT NULL,
  `updatedTS` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `is_delete` smallint(16) NOT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=44 ;

--
-- Dumping data for table `comp_payment_others_with_item`
--

INSERT INTO `comp_payment_others_with_item` (`ID`, `otherPaymentID`, `lineNo`, `itemID`, `itemname`, `itemdescription`, `quantity`, `unitPrice`, `amountExcludedTax`, `taxID`, `taxRate`, `taxAmount`, `amountIncludedTax`, `accountID`, `createdBy`, `createdTS`, `updatedBy`, `updatedTS`, `is_delete`) VALUES
(21, 11, 1, 2, 'Steel chair for outdoor', '100300100', 1, 500, 1, 1, 6, 30, 530, 13, 0, '2014-06-20 02:46:17', 0, '0000-00-00 00:00:00', 0),
(22, 11, 2, 1, 'Teak wooden chair with natural finish', '321000100', 100, 50, 1, 0, 0, 0, 500, 14, 0, '2014-06-20 02:46:38', 0, '0000-00-00 00:00:00', 0),
(23, 12, 1, 2, 'Steel chair for outdoor', '100300100', 1, 1, 1, 1, 6, 0, 0, 0, 0, '2014-06-20 02:46:28', 0, '0000-00-00 00:00:00', 0),
(24, 19, 1, 2, '100300100', 'Steel chair for outdoor', 1, 11, 11, 1, 6, 0, 0, 0, 16, '2014-06-20 02:46:44', 0, '0000-00-00 00:00:00', 0),
(25, 19, 2, 7, '331000200', 'Plastic Chair - Red', 12, 12, 144, 12, 5, 0, 0, 0, 16, '2014-06-20 02:46:48', 0, '0000-00-00 00:00:00', 0),
(26, 20, 1, 2, 'B13 Steel Chair', 'Steel chair for outdoor', 12, 1, 12, 1, 6, 0, 0, 0, 16, '2014-06-20 02:46:52', 0, '0000-00-00 00:00:00', 0),
(27, 20, 2, 4, 'A23 Plastic Chair', 'Plastic Chair - Blue', 1, 12, 12, 1, 6, 0, 0, 0, 16, '2014-06-20 02:46:59', 0, '0000-00-00 00:00:00', 0),
(28, 21, 1, 2, 'B13 Steel Chair', 'Steel chair for outdoor', 2, 12, 24, 1, 6, 0, 0, 0, 16, '2014-06-20 02:47:03', 0, '0000-00-00 00:00:00', 0),
(29, 21, 2, 9, 'Nasi Goreng', 'Nasi Goreng Ayam', 12, 21, 252, 26, 12, 0, 0, 0, 16, '2014-06-20 02:47:07', 0, '0000-00-00 00:00:00', 0),
(30, 21, 3, 7, 'A24 Plastic Chair', 'Plastic Chair - Red', 1, 1, 1, 0, 0, 0, 0, 0, 16, '2014-06-20 02:47:17', 0, '0000-00-00 00:00:00', 0),
(31, 22, 1, 2, 'B13 Steel Chair', 'Steel chair for outdoor', 1, 12, 12, 1, 6, 0.72, 12.72, 0, 16, '2014-06-20 02:47:20', 0, '0000-00-00 00:00:00', 0),
(32, 22, 2, 0, 'A12 Wooden Chair', 'Teak wooden chair with natural finish', 1, 12, 12, 1, 6, 0.72, 12.72, 0, 16, '2014-06-20 02:47:24', 16, '0000-00-00 00:00:00', 0),
(33, 25, 0, 0, '', 'Plastic Chair - Red', 2, 2345, 4690, 0, 0, 0, 4690, 0, 16, '2014-06-26 03:32:04', 0, '0000-00-00 00:00:00', 0),
(34, 26, 0, 1, '', 'Teak wooden chair with natural finish', 223, 12, 2676, 6, 0, 0, 2676, 0, 16, '2014-06-26 03:35:02', 0, '0000-00-00 00:00:00', 0),
(35, 27, 0, 1, '', 'Teak wooden chair with natural finish', 223, 12, 2676, 6, 0, 0, 2676, 0, 16, '2014-06-26 03:36:17', 0, '0000-00-00 00:00:00', 0),
(36, 28, 0, 1, '', 'Teak wooden chair with natural finish', 1, 12, 12, 0, 6, 0.72, 12.72, 0, 16, '2014-06-26 03:39:56', 0, '0000-00-00 00:00:00', 0),
(37, 28, 0, 7, '0', 'Plastic Chair - Red', 1, 2345, 2345, 0, 0, 0, 2345, 0, 16, '2014-06-26 03:40:13', 0, '0000-00-00 00:00:00', 0),
(38, 29, 0, 1, '', 'Teak wooden chair with natural finish', 2, 12, 24, 0, 6, 1.44, 25.44, 0, 16, '2014-06-26 04:53:00', 0, '0000-00-00 00:00:00', 0),
(39, 30, 0, 1, '', 'Teak wooden chair with natural finish', 2, 12, 24, 0, 6, 1.44, 25.44, 0, 16, '2014-06-26 04:53:00', 0, '0000-00-00 00:00:00', 0),
(40, 31, 0, 1, '', 'Teak wooden chair with natural finish', 2, 12, 24, 0, 6, 1.44, 25.44, 0, 16, '2014-06-26 04:53:00', 0, '0000-00-00 00:00:00', 0),
(42, 32, 2, 4, '', 'Plastic Chair - Blue', 1, 1, 1, 1, 6, 0.06, 1.06, 0, 16, '2014-06-26 09:36:43', 16, '0000-00-00 00:00:00', 0),
(43, 32, 3, 1, '', 'Teak wooden chair with natural finish', 1, 10, 10, 0, 6, 0.6, 10.6, 0, 16, '2014-07-07 00:36:49', 0, '0000-00-00 00:00:00', 0);

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

--
-- Table structure for table `comp_project`
--

CREATE TABLE IF NOT EXISTS `comp_project` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `companyID` int(11) NOT NULL,
  `project_name` varchar(128) NOT NULL,
  `projectManagerID` int(11) NOT NULL,
  `totalBudget` double NOT NULL,
  `remarks` text NOT NULL,
  `createdID` 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` smallint(16) NOT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=28 ;

--
-- Dumping data for table `comp_project`
--

INSERT INTO `comp_project` (`ID`, `companyID`, `project_name`, `projectManagerID`, `totalBudget`, `remarks`, `createdID`, `createdTS`, `updatedBy`, `updatedTS`, `is_delete`) VALUES
(1, 1, 'cuci servicesa', 1, 20, 'ntaha', 0, '2014-05-09 02:23:25', 0, '2014-06-02 11:05:38', 0),
(2, 1, 'cuci', 0, 0, 'dfdfd', 0, '2014-05-14 11:12:08', 0, '2014-05-14 11:23:41', 0),
(10, 1, 'software development', 0, 0, 'tender', 0, '2014-06-02 08:56:28', 0, '0000-00-00 00:00:00', 0),
(15, 1, 'clean', 0, 12, 'project baru', 0, '2014-06-02 10:55:12', 0, '0000-00-00 00:00:00', 0),
(16, 1, 'clean', 0, 20, 'project baru', 0, '2014-06-02 11:04:25', 0, '2014-06-24 09:56:53', 1),
(17, 1, 'project management', 0, 0, 'deposit', 0, '2014-06-03 01:16:15', 0, '0000-00-00 00:00:00', 0),
(18, 27, 'project management', 0, 0, 'depositdeposit', 0, '2014-06-06 09:30:03', 0, '2014-06-06 09:30:17', 0),
(19, 15, 'project A', 8, 100000, 'remarks projek A', 0, '2014-06-10 12:08:51', 0, '2014-06-10 12:11:43', 0),
(20, 57, 'Magazine', 16, 10, 'deposit', 0, '2014-07-09 02:25:42', 0, '0000-00-00 00:00:00', 0),
(21, 76, 'project management', 20, 10000, 'seploh ribu kali try', 0, '2014-07-17 04:53:31', 0, '0000-00-00 00:00:00', 0),
(22, 81, 'Pemasangan speaker dewan', 22, 0, 'bayaran deposit 10%', 0, '2014-07-21 02:11:32', 0, '0000-00-00 00:00:00', 0),
(23, 81, 'Pemasangan set audio pejabat kl sentral', 21, 0, 'deposit 10% diperlukan - pemasangan pendawaian ', 0, '2014-07-21 02:12:33', 0, '0000-00-00 00:00:00', 0),
(24, 1, 'Audio', 6, 0, '', 0, '2014-07-24 03:53:56', 0, '0000-00-00 00:00:00', 0),
(25, 1, 'myPremier', 30, 500000, '', 0, '2014-08-11 04:06:41', 0, '0000-00-00 00:00:00', 0),
(26, 84, 'Project 1', 29, 12345, 'New project', 0, '2014-08-13 04:45:43', 0, '0000-00-00 00:00:00', 0),
(27, 84, 'Project 2', 29, 231432, 'Project 2 start', 0, '2014-08-13 04:46:19', 0, '0000-00-00 00:00:00', 0);

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

--
-- Table structure for table `comp_purchase_order`
--

CREATE TABLE IF NOT EXISTS `comp_purchase_order` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `serialNo` int(11) NOT NULL,
  `companyID` int(11) NOT NULL,
  `purchaserID` int(11) NOT NULL,
  `supplierID` int(11) NOT NULL,
  `invoiceID` int(11) NOT NULL DEFAULT '0',
  `purchaseOrderNo` varchar(32) NOT NULL,
  `salesAgentName` varchar(64) NOT NULL,
  `formNo` varchar(16) NOT NULL,
  `poDate` date NOT NULL,
  `exchangeRate` double NOT NULL,
  `termAndConditionID` int(11) NOT NULL,
  `currencyID` int(11) NOT NULL,
  `createdBy` int(11) NOT NULL,
  `createdTS` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updatedBy` int(11) NOT NULL,
  `updateAble` tinyint(4) NOT NULL DEFAULT '1',
  `updatedTS` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
  `memo` varchar(255) NOT NULL,
  `is_delete` int(11) NOT NULL DEFAULT '0',
  `journalNo` varchar(32) NOT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=9 ;

--
-- Dumping data for table `comp_purchase_order`
--

INSERT INTO `comp_purchase_order` (`ID`, `serialNo`, `companyID`, `purchaserID`, `supplierID`, `invoiceID`, `purchaseOrderNo`, `salesAgentName`, `formNo`, `poDate`, `exchangeRate`, `termAndConditionID`, `currencyID`, `createdBy`, `createdTS`, `updatedBy`, `updateAble`, `updatedTS`, `memo`, `is_delete`, `journalNo`) VALUES
(1, 100000, 1, 7, 1, 0, '', '', 'P020140725PHG', '2014-07-25', 1, 17, 1, 16, '2014-07-25 04:36:08', 0, 1, '0000-00-00 00:00:00', 'sdsd', 0, ''),
(2, 100001, 1, 6, 1, 0, '', '', 'P020140725PHG', '2014-07-25', 1, 17, 1, 16, '2014-07-25 04:45:22', 0, 1, '0000-00-00 00:00:00', 'dgd', 0, ''),
(4, 100002, 1, 6, 1, 0, '', '', 'P020140804PHG', '2014-08-06', 1, 5, 1, 16, '2014-08-04 09:30:52', 0, 1, '0000-00-00 00:00:00', '', 0, ''),
(6, 1, 81, 27, 33, 0, '', '', 'PO20140805', '2014-08-05', 1, 5, 1, 33, '2014-08-05 04:23:09', 0, 0, '2014-08-05 04:23:43', '', 0, ''),
(7, 1, 84, 29, 34, 0, '', '', 'PO20140805', '2014-08-05', 3.2, 5, 1, 33, '2014-08-05 09:29:09', 0, 0, '2014-08-05 09:29:25', '', 0, ''),
(8, 2, 84, 29, 34, 0, '', '', 'PO20140806', '2014-08-13', 3.21, 6, 0, 33, '2014-08-06 02:44:02', 0, 0, '2014-08-06 02:44:14', 'ASD Asda ', 0, '');

--
-- Triggers `comp_purchase_order`
--
DROP TRIGGER IF EXISTS `trigger_before_insert_po_add_serial`;
DELIMITER //
CREATE TRIGGER `trigger_before_insert_po_add_serial` BEFORE INSERT ON `comp_purchase_order`
 FOR EACH ROW begin 
set new.serialNo = 
(select nextSerialNo from view_serial_comp_purchase_order 
	where companyID = new.companyID); 
end
//
DELIMITER ;

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

--
-- Table structure for table `comp_purchase_order_detail`
--

CREATE TABLE IF NOT EXISTS `comp_purchase_order_detail` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `purchaseOrderID` int(11) NOT NULL,
  `lineNo` int(11) NOT NULL,
  `itemID` int(11) NOT NULL,
  `itemCode` varchar(16) NOT NULL,
  `itemName` varchar(128) NOT NULL,
  `description` text,
  `unitPrice` double NOT NULL,
  `quantityOrder` int(11) NOT NULL,
  `quantityReceivedTotal` int(11) NOT NULL DEFAULT '0',
  `amount` 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,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=62 ;

--
-- Dumping data for table `comp_purchase_order_detail`
--

INSERT INTO `comp_purchase_order_detail` (`ID`, `purchaseOrderID`, `lineNo`, `itemID`, `itemCode`, `itemName`, `description`, `unitPrice`, `quantityOrder`, `quantityReceivedTotal`, `amount`, `createdBy`, `createdTS`, `updatedBy`, `updatedTS`) VALUES
(54, 1, 1, 8, '', '', 'Plastic Chair - White', 12, 1, 1, 12, 16, '2014-07-25 04:36:08', 0, '2014-07-31 02:21:14'),
(55, 2, 1, 7, '', '', 'Plastic Chair - Red', 2345, 1, 0, 2345, 16, '2014-07-25 04:45:22', 1, '2014-07-31 01:58:45'),
(57, 4, 1, 1, '', '', 'Teak wooden chair with natural finish', 34, 3, 0, 102, 16, '2014-08-04 09:30:52', 0, '0000-00-00 00:00:00'),
(59, 6, 1, 18, '', '', 'Dell High Specification', 34, 5, 0, 170, 33, '2014-08-05 04:23:09', 0, '2014-08-05 04:49:07'),
(60, 7, 1, 0, '', '', 'description', 34, 8, 8, 272, 33, '2014-08-05 09:29:09', 0, '2014-08-05 09:32:45'),
(61, 8, 1, 19, '', '', 'New Item description', 34, 20, 5, 680, 33, '2014-08-06 02:44:02', 0, '2014-08-06 03:10:31');

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

--
-- Table structure for table `comp_purchase_price`
--

CREATE TABLE IF NOT EXISTS `comp_purchase_price` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `companyID` int(11) NOT NULL,
  `itemID` int(11) NOT NULL,
  `supplierID` int(11) NOT NULL,
  `price` double NOT NULL,
  `updatedBy` varchar(50) NOT NULL,
  `updatedTS` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=24 ;

--
-- Dumping data for table `comp_purchase_price`
--

INSERT INTO `comp_purchase_price` (`ID`, `companyID`, `itemID`, `supplierID`, `price`, `updatedBy`, `updatedTS`) VALUES
(17, 1, 1, 1, 567, 'akmal', '2014-06-05 04:50:09'),
(19, 1, 9, 24, 768, 'akmal', '2014-06-05 04:50:39'),
(20, 1, 7, 1, 8769, 'akmal', '2014-06-05 04:50:52'),
(21, 1, 13, 25, 12431, 'sam', '2014-08-18 00:07:24'),
(22, 1, 10, 24, 12431, 'sam', '2014-08-18 00:07:39'),
(23, 1, 9, 29, 4321, 'sam', '2014-08-18 00:13:45');

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

--
-- Table structure for table `comp_quotation`
--

CREATE TABLE IF NOT EXISTS `comp_quotation` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `serialNo` int(11) NOT NULL DEFAULT '1',
  `companyID` int(11) NOT NULL,
  `customerID` int(11) NOT NULL,
  `quotationCode` varchar(32) NOT NULL,
  `salesAgentID` int(11) NOT NULL,
  `employeeID` int(11) unsigned NOT NULL,
  `formNo` varchar(32) NOT NULL,
  `quotationDate` date NOT NULL,
  `deliverToID` int(11) NOT NULL,
  `currencyID` int(11) NOT NULL,
  `supplierID` text NOT NULL,
  `memo` varchar(128) NOT NULL,
  `totalTaxAmount` double NOT NULL,
  `exchangeRate` double NOT NULL,
  `totalReceivable` 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,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=21 ;

--
-- Dumping data for table `comp_quotation`
--

INSERT INTO `comp_quotation` (`ID`, `serialNo`, `companyID`, `customerID`, `quotationCode`, `salesAgentID`, `employeeID`, `formNo`, `quotationDate`, `deliverToID`, `currencyID`, `supplierID`, `memo`, `totalTaxAmount`, `exchangeRate`, `totalReceivable`, `createdBy`, `createdTS`, `updatedBy`, `updatedTS`) VALUES
(1, 1, 1, 12, '', 0, 6, 'SQN2014', '2014-06-06', 7, 1, '', 'test memo', 28980, 1, 0, 1, '2014-06-06 02:21:02', 0, '2014-07-17 07:26:31'),
(3, 1, 1, 12, '', 0, 7, 'SQN2014', '2014-06-06', 7, 1, '', 'testttt', 5040, 1, 0, 1, '2014-06-06 02:26:19', 0, '2014-07-17 07:26:36'),
(4, 1, 1, 12, '', 0, 6, 'SQN2014', '2014-06-06', 8, 1, '', 'dasd', 3780, 1, 0, 1, '2014-06-06 02:28:04', 0, '2014-07-17 07:26:13'),
(5, 1, 1, 12, '', 0, 6, 'SQN2014', '2014-06-06', 7, 1, '', 'dfsd', 1260, 1, 0, 1, '2014-06-06 04:12:32', 0, '2014-07-17 07:26:04'),
(6, 1, 1, 12, '', 0, 6, 'SQN2014', '2014-06-06', 7, 1, '', 'afs', 44100, 1, 0, 1, '2014-06-06 04:22:54', 1, '2014-07-17 07:25:59'),
(7, 1, 1, 12, '', 0, 6, 'SQN2014', '2014-06-06', 7, 1, '', 'dsfs', 15120, 1, 0, 1, '2014-06-06 07:09:39', 1, '2014-07-17 07:25:54'),
(8, 1, 1, 12, '', 0, 6, 'SQN2014', '2014-06-06', 7, 1, '', 'dsfs', 15498, 1, 0, 1, '2014-06-06 07:10:06', 0, '2014-07-17 07:25:50'),
(9, 1, 1, 12, '', 0, 6, 'SQN2014', '2014-06-06', 7, 1, '', 'dsfds', 1764, 1, 0, 1, '2014-06-06 07:14:44', 1, '2014-07-17 07:25:44'),
(10, 1, 1, 12, '', 0, 6, 'SQN2014', '2014-06-06', 7, 1, '', 'dsfds', 4662, 1, 0, 1, '2014-06-06 07:15:02', 0, '2014-07-17 07:25:38'),
(11, 1, 1, 12, '', 0, 6, 'SQN2014', '2014-06-06', 8, 1, '', 'hgh', 14616, 1, 0, 1, '2014-06-06 07:17:50', 1, '2014-07-17 07:25:31'),
(12, 1, 1, 12, '', 0, 6, 'SQN2014', '2014-06-06', 8, 1, '', 'hgh', 15246, 1, 0, 1, '2014-06-06 07:18:08', 0, '2014-07-17 07:25:26'),
(13, 1, 1, 12, '', 0, 6, 'SQN2014', '2014-06-06', 8, 1, '', 'fgdfg', 4914, 1, 0, 1, '2014-06-06 07:19:07', 1, '2014-07-17 07:25:17'),
(14, 1, 1, 12, '', 0, 6, 'SQN2014', '2014-06-06', 8, 1, '', 'fgdfg', 20286, 1, 0, 1, '2014-06-06 07:19:27', 0, '2014-07-17 07:25:11'),
(15, 1, 15, 17, '', 0, 9, 'SQN2014', '2014-07-17', 5, 1, '', '', 212, 1, 0, 16, '2014-07-17 02:35:53', 0, '2014-07-17 07:24:58'),
(16, 1, 15, 17, '', 0, 8, 'SQN2014', '2014-07-17', 5, 1, '', '', 371, 1, 0, 16, '2014-07-17 03:10:55', 0, '2014-07-17 07:24:52'),
(17, 1, 1, 12, '', 0, 6, 'SQN2014', '2014-07-17', 7, 1, '', 'Hello world', 19451, 1, 0, 16, '2014-07-17 07:42:19', 16, '2014-07-17 08:04:13'),
(18, 1, 1, 20, '', 0, 6, 'SQN2014', '2014-07-17', 8, 1, '', 'Lorem ipsum dolor sit emet ', 6360, 1, 0, 16, '2014-07-17 07:56:18', 0, '2014-07-17 08:04:22'),
(19, 1, 1, 12, '', 0, 6, 'SQN2014', '2014-07-17', 8, 1, '', 'afdasdfasdf', 73.14, 1, 0, 16, '2014-07-17 08:04:48', 0, '0000-00-00 00:00:00'),
(20, 1, 81, 34, '', 0, 27, 'SQN', '2014-08-05', 0, 1, '', 'test', 0, 1, 0, 29, '2014-08-05 01:28:27', 29, '2014-08-05 01:28:53');

--
-- Triggers `comp_quotation`
--
DROP TRIGGER IF EXISTS `trigger_before_insert_cq_add_serialNo`;
DELIMITER //
CREATE TRIGGER `trigger_before_insert_cq_add_serialNo` BEFORE INSERT ON `comp_quotation`
 FOR EACH ROW set new.serialNo = (select nextSerialNo 
			   from view_serial_comp_quotation 
			   where companyID = new.companyID)
//
DELIMITER ;

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

--
-- Table structure for table `comp_quotation_detail`
--

CREATE TABLE IF NOT EXISTS `comp_quotation_detail` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `quotationID` int(11) NOT NULL,
  `lineNo` int(11) NOT NULL,
  `itemID` int(11) NOT NULL,
  `description` varchar(200) NOT NULL,
  `unitOfPrice` double NOT NULL,
  `quantityOrder` int(11) NOT NULL,
  `amountExcludeTax` double DEFAULT NULL,
  `taxID` int(11) NOT NULL,
  `umID` int(11) NOT NULL,
  `taxRate` double NOT NULL,
  `taxAmount` double NOT NULL,
  `amountIncudeTax` 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,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=29 ;

--
-- Dumping data for table `comp_quotation_detail`
--

INSERT INTO `comp_quotation_detail` (`ID`, `quotationID`, `lineNo`, `itemID`, `description`, `unitOfPrice`, `quantityOrder`, `amountExcludeTax`, `taxID`, `umID`, `taxRate`, `taxAmount`, `amountIncudeTax`, `createdBy`, `createdTS`, `updatedBy`, `updatedTS`) VALUES
(1, 1, 0, 1, 'Teak wooden chair with natural finish', 120, 230, 27600, 12, 2, 5, 1380, 28980, 1, '2014-06-06 02:21:02', 0, '0000-00-00 00:00:00'),
(4, 3, 0, 1, 'Teak wooden chair with natural finish', 120, 40, 4800, 12, 2, 5, 240, 5040, 1, '2014-06-06 02:26:19', 0, '0000-00-00 00:00:00'),
(5, 4, 0, 1, 'Teak wooden chair with natural finish', 120, 30, 3600, 12, 2, 5, 180, 3780, 1, '2014-06-06 02:28:04', 0, '0000-00-00 00:00:00'),
(7, 6, 0, 1, 'Teak wooden chair with natural finish', 120, 20, 2400, 12, 2, 5, 120, 2520, 1, '2014-06-06 04:22:54', 0, '0000-00-00 00:00:00'),
(8, 6, 0, 1, 'Teak wooden chair with natural finish', 120, 330, 39600, 12, 2, 5, 1980, 41580, 1, '2014-06-06 04:23:03', 0, '0000-00-00 00:00:00'),
(9, 7, 0, 1, 'Teak wooden chair with natural finish', 120, 10, 1200, 12, 2, 5, 60, 1260, 1, '2014-06-06 07:09:39', 0, '0000-00-00 00:00:00'),
(10, 7, 0, 1, 'Teak wooden chair with natural finish', 120, 110, 13200, 12, 2, 5, 660, 13860, 1, '2014-06-06 07:09:53', 0, '0000-00-00 00:00:00'),
(11, 8, 0, 1, 'Teak wooden chair with natural finish', 120, 3, 360, 12, 2, 5, 18, 378, 1, '2014-06-06 07:10:06', 0, '0000-00-00 00:00:00'),
(12, 9, 0, 1, 'Teak wooden chair with natural finish', 120, 10, 1200, 12, 2, 5, 60, 1260, 1, '2014-06-06 07:14:44', 0, '0000-00-00 00:00:00'),
(13, 9, 0, 1, 'Teak wooden chair with natural finish', 120, 4, 480, 12, 2, 5, 24, 504, 1, '2014-06-06 07:14:54', 0, '0000-00-00 00:00:00'),
(14, 10, 0, 1, 'Teak wooden chair with natural finish', 120, 23, 2760, 12, 2, 5, 138, 2898, 1, '2014-06-06 07:15:02', 0, '0000-00-00 00:00:00'),
(15, 11, 0, 1, 'Teak wooden chair with natural finish', 120, 4, 480, 12, 2, 5, 24, 504, 1, '2014-06-06 07:17:50', 0, '0000-00-00 00:00:00'),
(16, 11, 0, 1, 'Teak wooden chair with natural finish', 120, 112, 13440, 12, 2, 5, 672, 14112, 1, '2014-06-06 07:17:58', 0, '0000-00-00 00:00:00'),
(17, 12, 0, 1, 'Teak wooden chair with natural finish', 120, 5, 600, 12, 2, 5, 30, 630, 1, '2014-06-06 07:18:08', 0, '0000-00-00 00:00:00'),
(18, 13, 0, 1, 'Teak wooden chair with natural finish', 120, 34, 4080, 12, 2, 5, 204, 4284, 1, '2014-06-06 07:19:07', 0, '0000-00-00 00:00:00'),
(19, 13, 0, 1, 'Teak wooden chair with natural finish', 120, 5, 600, 12, 2, 5, 30, 630, 1, '2014-06-06 07:19:17', 0, '0000-00-00 00:00:00'),
(20, 14, 0, 1, 'Teak wooden chair with natural finish', 120, 122, 14640, 12, 2, 5, 732, 15372, 1, '2014-06-06 07:19:27', 0, '0000-00-00 00:00:00'),
(21, 15, 0, 12, 'saiz 10. warna hitam', 200, 1, 200, 1, 2, 6, 12, 212, 16, '2014-07-17 02:35:54', 0, '0000-00-00 00:00:00'),
(22, 16, 0, 11, 'saiz 10. warna gold', 350, 1, 350, 1, 2, 6, 21, 371, 16, '2014-07-17 03:10:55', 0, '0000-00-00 00:00:00'),
(23, 17, 0, 1, 'Teak wooden chair with natural finish', 120, 100, 12000, 1, 2, 6, 720, 12720, 16, '2014-07-17 07:42:19', 0, '0000-00-00 00:00:00'),
(24, 17, 0, 8, 'Plastic Chair - White', 127, 50, 6350, 10, 2, 6, 381, 6731, 16, '2014-07-17 07:43:48', 0, '0000-00-00 00:00:00'),
(25, 18, 0, 2, 'Steel chair for outdoor', 120, 50, 6000, 1, 2, 6, 360, 6360, 16, '2014-07-17 07:56:18', 0, '0000-00-00 00:00:00'),
(26, 19, 0, 8, 'Plastic Chair - White', 23, 3, 69, 1, 2, 6, 4.14, 73.14, 16, '2014-07-17 08:04:48', 0, '0000-00-00 00:00:00'),
(27, 20, 0, 17, 'laptop', 170, 2, 340, 1, 3, 0, 0, 0, 29, '2014-08-05 01:28:28', 0, '0000-00-00 00:00:00'),
(28, 20, 0, 16, 'micro', 100, 1, 100, 1, 3, 0, 0, 0, 29, '2014-08-05 01:28:53', 0, '0000-00-00 00:00:00');

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

--
-- Table structure for table `comp_receive_item`
--

CREATE TABLE IF NOT EXISTS `comp_receive_item` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `serialNo` int(11) NOT NULL DEFAULT '1',
  `companyID` int(11) NOT NULL,
  `supplierDoNo` varchar(32) NOT NULL,
  `purchaseOrderID` int(11) NOT NULL,
  `supplierID` int(11) NOT NULL,
  `formNo` varchar(32) NOT NULL,
  `deliveryDate` date NOT NULL,
  `locationID` int(11) NOT NULL,
  `deliverToID` int(11) NOT NULL,
  `currencyID` int(11) NOT NULL,
  `exchangeRate` float NOT NULL,
  `employeeID` int(11) NOT NULL,
  `memo` text NOT NULL,
  `shippingMethodID` int(11) NOT NULL,
  `totalAmount` double NOT NULL,
  `totalPayable` double NOT NULL,
  `journalNo` varchar(32) NOT NULL,
  `updateAble` smallint(6) NOT NULL DEFAULT '1',
  `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 AUTO_INCREMENT=82 ;

--
-- Dumping data for table `comp_receive_item`
--

INSERT INTO `comp_receive_item` (`ID`, `serialNo`, `companyID`, `supplierDoNo`, `purchaseOrderID`, `supplierID`, `formNo`, `deliveryDate`, `locationID`, `deliverToID`, `currencyID`, `exchangeRate`, `employeeID`, `memo`, `shippingMethodID`, `totalAmount`, `totalPayable`, `journalNo`, `updateAble`, `createdBy`, `createdTS`, `updatedBy`, `updatedTS`) VALUES
(8, 1, 1, 'fds', 2, 1, 'GRN', '2014-05-28', 1, 0, 0, 0, 6, '', 0, 0, 0, '', 1, 0, '2014-05-28 04:51:53', 0, '2014-06-13 10:47:37'),
(9, 1, 1, 'd', 2, 1, 'GRN', '2014-05-28', 1, 0, 0, 0, 6, '', 0, 0, 0, '', 1, 0, '2014-05-28 04:58:34', 0, '2014-05-29 10:54:31'),
(10, 1, 1, 's', 2, 1, 'GRN', '2014-05-28', 1, 0, 0, 0, 6, '', 0, 0, 0, '', 1, 0, '2014-05-28 05:00:14', 0, '2014-05-29 10:54:31'),
(11, 1, 1, 'ada', 2, 1, 'GRN', '2014-05-14', 1, 0, 0, 0, 6, '', 0, 0, 0, '', 1, 0, '2014-05-28 05:03:29', 0, '2014-07-14 02:41:28'),
(12, 1, 1, 's', 2, 1, 'GRN', '2014-05-28', 1, 0, 0, 0, 6, '', 0, 0, 0, '', 1, 0, '2014-05-28 05:04:35', 0, '2014-05-29 10:54:31'),
(13, 1, 1, 'GU', 2, 1, 'GRN', '2014-05-28', 1, 0, 0, 0, 6, '', 0, 0, 0, '', 1, 0, '2014-05-28 06:09:27', 0, '2014-05-29 10:54:31'),
(14, 1, 1, 'sd', 2, 1, 'GRN', '2014-05-28', 1, 0, 0, 0, 6, '                                  \n                             ', 0, 0, 0, '', 1, 0, '2014-05-28 07:33:16', 0, '2014-05-29 10:54:31'),
(15, 1, 1, 'as', 2, 1, 'GRN', '2014-05-12', 1, 0, 0, 0, 6, '                                  \n                             ', 0, 0, 0, '', 1, 0, '2014-05-28 07:35:37', 0, '2014-07-14 02:41:35'),
(16, 1, 1, 'as', 2, 1, 'GRN', '2014-05-28', 1, 0, 1, 1, 6, '', 0, 0, 0, '', 1, 0, '2014-05-28 07:52:13', 0, '2014-07-01 01:43:29'),
(17, 1, 1, 'bnvb', 2, 1, 'GRN', '2014-05-28', 1, 0, 0, 0, 6, '', 0, 0, 0, '', 1, 0, '2014-05-28 08:05:33', 0, '2014-05-29 10:54:31'),
(18, 1, 1, 'sds', 2, 1, 'GRN', '2014-05-13', 1, 0, 0, 0, 6, '', 0, 0, 0, '', 1, 0, '2014-05-28 08:19:27', 0, '2014-05-29 10:54:31'),
(19, 1, 1, 'ds', 2, 1, 'GRN', '2014-05-28', 1, 0, 0, 0, 6, '', 0, 0, 0, '', 1, 0, '2014-05-28 08:21:06', 0, '2014-05-29 10:54:31'),
(20, 1, 1, 'dfd', 2, 1, 'GRN', '2014-05-28', 1, 0, 0, 0, 6, '', 0, 0, 0, '', 1, 0, '2014-05-28 08:21:40', 0, '2014-05-29 10:54:31'),
(21, 1, 1, 'sd', 2, 1, 'GRN', '2014-04-09', 1, 0, 1, 1, 6, '', 0, 0, 0, '', 1, 0, '2014-05-28 08:24:02', 0, '2014-07-14 02:41:41'),
(22, 1, 1, 'd', 2, 1, 'GRN', '2014-05-28', 1, 0, 0, 0, 6, '', 0, 0, 0, '', 1, 0, '2014-05-28 08:31:14', 0, '2014-05-29 10:54:31'),
(23, 1, 1, 'dfd', 2, 1, 'GRN', '2014-05-28', 1, 0, 0, 0, 6, 'xasa', 0, 0, 0, '', 1, 0, '2014-05-28 08:32:30', 0, '2014-05-29 10:54:31'),
(24, 1, 1, '', 2, 1, 'GRN', '2014-05-28', 2, 0, 0, 0, 6, '', 0, 0, 0, '', 1, 0, '2014-05-28 08:33:14', 0, '2014-06-19 07:00:06'),
(25, 1, 1, 'ds', 2, 1, 'GRN', '2014-05-29', 1, 0, 0, 0, 6, 'sdsd', 0, 0, 0, '', 1, 0, '2014-05-29 07:14:24', 0, '2014-05-29 10:54:31'),
(26, 1, 1, 'bvgmj', 2, 1, 'GRN', '2014-05-29', 1, 0, 0, 0, 6, '', 0, 0, 0, '', 1, 0, '2014-05-29 07:23:51', 0, '2014-05-29 10:54:31'),
(27, 1, 1, 'as', 2, 1, 'GRN', '2014-05-29', 1, 0, 0, 0, 6, 'dsd', 0, 0, 0, '', 1, 0, '2014-05-29 08:04:01', 0, '2014-05-29 10:54:31'),
(28, 1, 1, 'as', 2, 1, 'GRN', '2014-05-29', 1, 0, 0, 0, 6, 'sds', 0, 0, 0, '', 1, 0, '2014-05-29 08:06:57', 0, '2014-05-29 10:54:31'),
(29, 1, 1, 'sds', 2, 1, 'GRN', '2014-05-29', 1, 0, 0, 0, 0, 'ada', 0, 0, 0, '', 1, 0, '2014-05-29 10:57:01', 0, '0000-00-00 00:00:00'),
(30, 1, 1, 'asa', 2, 1, 'GRN', '2014-05-29', 1, 0, 0, 0, 7, 'ad', 0, 0, 0, '', 1, 0, '2014-05-29 11:06:33', 0, '0000-00-00 00:00:00'),
(31, 1, 1, 'sd', 3, 1, 'GRN', '2014-05-29', 1, 0, 0, 0, 7, 'dsd', 3, 0, 0, '', 1, 0, '2014-05-29 11:12:57', 0, '0000-00-00 00:00:00'),
(32, 1, 15, 'supplier do no', 11, 26, 'GRN2014', '2014-06-11', 3, 0, 0, 0, 0, '', 0, 0, 0, '', 1, 0, '2014-06-11 05:10:38', 0, '2014-07-03 00:28:35'),
(33, 1, 15, 'hk', 12, 27, 'GRN2014', '2014-06-12', 4, 0, 0, 0, 0, '', 0, 0, 0, '', 1, 0, '2014-06-12 09:43:40', 0, '2014-07-03 00:28:40'),
(34, 1, 1, '0', 0, 0, '0', '1970-01-01', 0, 0, 0, 0, 0, '0', 0, 0, 0, '', 1, 0, '2014-06-16 07:20:43', 0, '0000-00-00 00:00:00'),
(35, 1, 1, '0', 0, 0, '0', '1970-01-01', 0, 0, 0, 0, 0, '0', 0, 0, 0, '', 1, 0, '2014-06-16 07:20:58', 0, '0000-00-00 00:00:00'),
(36, 1, 1, '0', 0, 0, '0', '1970-01-01', 0, 0, 0, 0, 0, '0', 0, 0, 0, '', 1, 0, '2014-06-16 07:22:21', 0, '0000-00-00 00:00:00'),
(37, 1, 1, 'wew', 18, 1, 'GRN', '2014-06-24', 1, 0, 0, 0, 7, 'ew', 0, 0, 0, '', 1, 0, '2014-06-24 06:45:36', 0, '0000-00-00 00:00:00'),
(38, 1, 1, 'as', 2, 1, 'GRN', '2014-06-24', 1, 0, 0, 0, 0, '', 0, 0, 0, '', 1, 0, '2014-06-24 08:25:19', 0, '0000-00-00 00:00:00'),
(39, 1, 1, 'sds', 2, 1, 'GRN', '2014-06-24', 0, 0, 0, 0, 0, '', 0, 0, 0, '', 1, 0, '2014-06-24 09:23:56', 0, '0000-00-00 00:00:00'),
(40, 1, 1, 'qwq', 2, 1, 'GRN', '2014-06-24', 2, 0, 0, 0, 6, 'assasas', 74, 0, 0, '', 1, 0, '2014-06-24 09:31:20', 0, '0000-00-00 00:00:00'),
(41, 1, 1, 'asa', 8, 20, 'GRN', '2014-06-24', 1, 0, 0, 0, 0, 'qwq', 0, 0, 0, '', 1, 0, '2014-06-24 09:41:19', 0, '0000-00-00 00:00:00'),
(42, 1, 1, 'wqw', 8, 20, 'GRN', '2014-06-24', 1, 0, 0, 0, 7, 'qw', 74, 0, 0, '', 1, 0, '2014-06-24 10:01:02', 0, '0000-00-00 00:00:00'),
(43, 1, 1, 'asa', 7, 23, 'GRN', '2014-06-24', 2, 0, 0, 0, 7, 'asa', 5, 0, 0, '', 1, 0, '2014-06-24 11:47:22', 0, '0000-00-00 00:00:00'),
(44, 1, 1, 'qwq', 14, 1, 'GRN', '2014-06-25', 2, 0, 0, 0, 6, 'wq wqewx weq wdqe', 74, 0, 0, 'PO20140600000002', 1, 0, '2014-06-25 00:43:14', 0, '2014-07-01 08:01:02'),
(45, 1, 1, 'sdw', 10, 20, 'GRN', '2014-06-25', 1, 0, 0, 0, 0, '', 0, 0, 0, 'PO20140600000011', 1, 0, '2014-06-25 00:48:52', 0, '2014-07-02 08:34:52'),
(46, 1, 1, 'SDSAD', 7, 23, 'GRN', '2014-06-25', 1, 0, 0, 0, 0, '', 0, 0, 0, '', 1, 0, '2014-06-25 02:03:10', 0, '0000-00-00 00:00:00'),
(47, 1, 1, 'WE', 19, 1, 'GRN', '2014-06-25', 1, 0, 0, 0, 7, 'SD SDS', 73, 0, 0, '', 1, 0, '2014-06-25 02:04:01', 0, '0000-00-00 00:00:00'),
(48, 1, 1, 'SDW', 2, 1, 'GRN', '2014-06-25', 1, 0, 0, 0, 7, 'SDW', 73, 0, 0, '', 1, 0, '2014-06-25 02:15:12', 0, '0000-00-00 00:00:00'),
(49, 1, 1, 'EWE', 14, 1, 'GRN', '2014-06-25', 2, 0, 0, 0, 0, '', 0, 0, 0, '', 1, 0, '2014-06-25 02:26:18', 0, '0000-00-00 00:00:00'),
(50, 1, 1, 'SDA', 19, 1, 'GRN', '2014-06-25', 1, 0, 0, 0, 0, '', 0, 0, 0, '', 1, 0, '2014-06-25 05:09:57', 0, '0000-00-00 00:00:00'),
(51, 1, 1, 'qwq', 19, 1, 'GRN', '2014-06-25', 2, 0, 0, 0, 7, 'wqwq', 8, 0, 0, '', 1, 0, '2014-06-25 05:16:08', 0, '0000-00-00 00:00:00'),
(52, 1, 1, '12', 17, 1, 'GRN', '2014-06-25', 2, 0, 0, 0, 0, '', 0, 0, 0, '', 1, 0, '2014-06-25 05:21:54', 0, '0000-00-00 00:00:00'),
(53, 1, 1, 'ewe', 15, 1, 'GRN', '2014-06-25', 1, 0, 0, 0, 7, 'wewewe', 8, 0, 0, '', 1, 0, '2014-06-25 05:24:09', 0, '0000-00-00 00:00:00'),
(54, 1, 1, 'DWQ', 7, 23, 'GRN', '2014-06-25', 1, 0, 2, 0, 0, '', 0, 0, 0, '', 1, 0, '2014-06-25 06:03:09', 0, '0000-00-00 00:00:00'),
(55, 1, 1, '23', -1, 1, 'GRN', '2014-06-25', 2, 0, 1, 0, 0, '', 0, 0, 0, '', 1, 0, '2014-06-25 06:04:49', 0, '0000-00-00 00:00:00'),
(56, 1, 1, 'WE', 19, 1, 'GRN', '2014-06-25', 1, 0, 1, 0, 0, '', 0, 0, 0, '', 1, 0, '2014-06-25 06:06:09', 0, '0000-00-00 00:00:00'),
(57, 1, 1, '', 19, 1, 'GRN', '2014-06-25', 0, 0, 1, 0, 0, '', 0, 0, 0, '', 1, 0, '2014-06-25 06:10:38', 0, '0000-00-00 00:00:00'),
(58, 1, 1, 'QWQ', 19, 1, 'GRN', '2014-06-25', 2, 0, 1, 0, 0, '', 0, 0, 0, '', 1, 0, '2014-06-25 06:14:02', 0, '0000-00-00 00:00:00'),
(59, 1, 1, 'sd', 19, 1, 'GRN', '2014-06-25', 1, 0, 1, 0, 0, '', 0, 0, 0, '', 1, 0, '2014-06-25 06:38:17', 0, '0000-00-00 00:00:00'),
(60, 1, 1, 'sd', 19, 1, 'GRN', '2014-06-25', 1, 0, 1, 0, 7, 'sqaa', 8, 0, 0, '', 1, 0, '2014-06-25 06:42:52', 0, '0000-00-00 00:00:00'),
(61, 1, 1, 'sda', 19, 1, 'GRN', '2014-06-26', 1, 0, 1, 0, 0, '', 0, 0, 0, '', 0, 0, '2014-06-26 01:56:34', 0, '2014-07-01 07:47:58'),
(62, 1, 15, 'sup do', 20, 26, 'GRN2014', '2014-07-02', 5, 0, 2, 0, 0, '', 0, 0, 0, '', 1, 0, '2014-07-02 08:10:27', 0, '0000-00-00 00:00:00'),
(63, 1, 1, 'gfgdt', 6, 1, 'GRN', '2014-07-03', 1, 0, 1, 0, 0, '', 0, 0, 0, '', 1, 0, '2014-07-03 09:06:26', 0, '0000-00-00 00:00:00'),
(64, 1, 1, 'asa', 6, 1, 'GRN', '2014-07-03', 1, 0, 1, 0, 0, '', 0, 0, 0, '', 1, 0, '2014-07-03 09:10:37', 0, '0000-00-00 00:00:00'),
(65, 1, 1, 'frgf', 14, 1, 'GRN', '2014-07-03', 2, 0, 1, 1, 0, '', 0, 0, 0, '', 1, 0, '2014-07-03 09:13:03', 0, '0000-00-00 00:00:00'),
(66, 1, 1, '', 0, 0, 'GRN', '2014-07-03', 0, 0, 0, 0, 0, '', 0, 0, 0, '', 1, 0, '2014-07-03 09:15:13', 0, '0000-00-00 00:00:00'),
(67, 1, 1, 'df', 15, 1, 'GRN', '2014-07-03', 1, 0, 1, 23, 0, 'sdsdfs', 0, 0, 0, '', 1, 0, '2014-07-03 09:16:18', 0, '0000-00-00 00:00:00'),
(68, 1, 1, '123456', 24, 31, 'GRN', '2014-07-09', 1, 0, 1, 1, 0, '', 0, 0, 0, 'PO20140700000001', 0, 0, '2014-07-09 02:52:02', 0, '2014-07-09 02:52:41'),
(69, 1, 1, '1122', 24, 31, 'GRN', '2014-07-09', 1, 0, 1, 1, 0, '', 0, 0, 0, '', 1, 0, '2014-07-09 03:10:25', 0, '0000-00-00 00:00:00'),
(70, 1, 15, 'awan hitam do no', 21, 27, 'GRN2014', '2014-07-09', 5, 0, 1, 1, 0, '', 0, 0, 0, '', 1, 0, '2014-07-09 04:58:31', 0, '0000-00-00 00:00:00'),
(71, 1, 15, 'sfsd23454', 25, 26, 'GRN2014', '2014-07-10', 5, 0, 2, 1, 0, '', 0, 0, 0, 'PO20140200000001', 0, 0, '2014-07-10 03:39:35', 0, '2014-07-10 03:49:04'),
(72, 1, 81, '001', 26, 32, 'GRN', '2014-07-21', 9, 0, 1, 1, 0, '', 0, 0, 0, '', 1, 0, '2014-07-21 07:00:58', 0, '0000-00-00 00:00:00'),
(73, 2, 1, 'asa', 1, 1, 'GRN', '2014-07-31', 1, 0, 1, 1, 6, 'sdsd', 73, 0, 0, '', 1, 0, '2014-07-31 02:21:14', 0, '0000-00-00 00:00:00'),
(74, 3, 1, 'asa', 1, 1, 'GRN', '2014-07-31', 1, 0, 1, 1, 6, 'sdsd', 73, 0, 0, '', 1, 0, '2014-07-31 02:21:18', 0, '0000-00-00 00:00:00'),
(75, 4, 1, 'asa', 1, 1, 'GRN', '2014-07-31', 1, 0, 1, 1, 6, 'sdsd', 73, 0, 0, '', 1, 0, '2014-07-31 02:21:23', 0, '0000-00-00 00:00:00'),
(76, 2, 81, '0006', 3, 33, 'GRN', '2014-08-04', 9, 0, 1, 1, 0, '', 0, 0, 0, '', 0, 0, '2014-08-04 03:14:32', 0, '2014-08-04 03:15:14'),
(77, 3, 81, 'ffjk565', 5, 33, 'GRN', '2014-08-04', 9, 0, 1, 1, 0, '', 0, 0, 0, '', 1, 0, '2014-08-04 10:11:56', 0, '0000-00-00 00:00:00'),
(78, 4, 81, 'asdfas34535', 6, 33, 'GRN', '2014-08-05', 9, 0, 1, 1, 0, '', 0, 0, 0, '', 1, 0, '2014-08-05 04:24:42', 0, '0000-00-00 00:00:00'),
(79, 1, 84, 'dfasdf3425', 7, 34, 'GRN', '2014-08-05', 10, 0, 1, 3.2, 0, '', 0, 0, 0, '', 1, 0, '2014-08-05 09:31:07', 0, '0000-00-00 00:00:00'),
(80, 2, 84, 'afasdf3455', 7, 34, 'GRN', '2014-08-05', 10, 0, 1, 1, 0, '', 0, 0, 0, '', 1, 0, '2014-08-05 09:31:57', 0, '0000-00-00 00:00:00'),
(81, 3, 84, 'sfgsfg56356345', 8, 34, 'GRN', '2014-08-06', 10, 0, 1, 1, 29, '', 73, 0, 0, '', 1, 0, '2014-08-06 03:10:31', 0, '0000-00-00 00:00:00');

--
-- Triggers `comp_receive_item`
--
DROP TRIGGER IF EXISTS `trigger_before_insert_ritem_add_serialNo`;
DELIMITER //
CREATE TRIGGER `trigger_before_insert_ritem_add_serialNo` BEFORE INSERT ON `comp_receive_item`
 FOR EACH ROW set new.serialNo = (select nextSerialNo 
			   from view_serial_comp_receive_item
			   where companyID = new.companyID)
//
DELIMITER ;

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

--
-- Table structure for table `comp_receive_item_detail`
--

CREATE TABLE IF NOT EXISTS `comp_receive_item_detail` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `receiveID` int(11) NOT NULL,
  `invoiceID` int(11) NOT NULL DEFAULT '0',
  `lineNo` int(11) NOT NULL,
  `poDetailID` int(11) NOT NULL,
  `itemID` int(11) NOT NULL,
  `itemCode` varchar(16) NOT NULL,
  `itemName` varchar(128) NOT NULL,
  `description` text,
  `unitPrice` double NOT NULL,
  `quantityOrder` double NOT NULL,
  `quantityReceived` double NOT NULL DEFAULT '0',
  `umID` int(11) NOT NULL DEFAULT '0',
  `amount` double NOT NULL,
  `balanceItem` 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,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=173 ;

--
-- Dumping data for table `comp_receive_item_detail`
--

INSERT INTO `comp_receive_item_detail` (`ID`, `receiveID`, `invoiceID`, `lineNo`, `poDetailID`, `itemID`, `itemCode`, `itemName`, `description`, `unitPrice`, `quantityOrder`, `quantityReceived`, `umID`, `amount`, `balanceItem`, `createdBy`, `createdTS`, `updatedBy`, `updatedTS`) VALUES
(7, 8, 181, 0, 2, 2, '100300100', 'kelapa muda hijau', 'kelapa', 1, 11, 5, 2, 11, 0, 16, '2014-05-28 04:51:53', 0, '2014-07-14 05:58:24'),
(8, 8, 181, 0, 3, 4, '331000100', 'labu sayong dibuat daripada tanah liat', 'loo kok ilang', 1, 12, 2, 2, 12, 0, 16, '2014-05-28 04:52:16', 0, '2014-07-14 05:58:24'),
(9, 9, 181, 0, 2, 2, '100300100', 'kelapa muda hijau', 'kelapa', 1, 11, 5, 2, 11, 0, 16, '2014-05-28 04:58:34', 0, '2014-07-14 05:58:24'),
(10, 9, 179, 0, 3, 4, '331000100', 'labu sayong dibuat daripada tanah liat', 'loo kok ilang', 1, 12, 1, 2, 12, 0, 16, '2014-05-28 04:58:48', 0, '2014-07-14 05:31:07'),
(11, 10, 178, 0, 2, 2, '100300100', 'kelapa muda hijau', 'kelapa', 1, 11, 5, 2, 11, 4, 16, '2014-05-28 05:00:14', 0, '2014-07-14 05:27:13'),
(12, 10, 178, 0, 4, 7, '331000200', 'jackfruit', 'Buah', 1, 11, 5, 2, 11, 5, 16, '2014-05-28 05:00:19', 0, '2014-07-14 05:27:13'),
(13, 11, 177, 0, 2, 2, '100300100', 'kelapa muda hijau', 'kelapa', 1, 11, 5, 2, 11, 5, 16, '2014-05-28 05:03:29', 0, '2014-07-14 05:21:47'),
(14, 11, 177, 0, 3, 4, '331000100', 'labu sayong dibuat daripada tanah liat', 'loo kok ilang', 1, 12, 1, 2, 12, 1, 16, '2014-05-28 05:03:33', 0, '2014-08-19 01:29:28'),
(15, 12, 179, 0, 2, 2, '100300100', 'kelapa muda hijau', 'kelapa', 1, 11, 5, 2, 11, 5, 16, '2014-05-28 05:04:35', 0, '2014-07-14 05:31:07'),
(16, 13, 184, 0, 2, 2, '100300100', 'kelapa muda hijau', 'kelapa', 1, 11, 5, 2, 11, 5, 16, '2014-05-28 06:09:27', 0, '2014-07-16 01:04:15'),
(17, 14, 184, 0, 4, 7, '331000200', 'jackfruit', 'Buah', 1, 11, 5, 2, 11, 5, 16, '2014-05-28 07:33:16', 0, '2014-07-16 01:04:15'),
(18, 15, 174, 0, 3, 4, '331000100', 'labu sayong dibuat daripada tanah liat', 'loo kok ilang', 1, 12, 1, 2, 12, 1, 16, '2014-05-28 07:35:37', 0, '2014-08-19 01:29:28'),
(19, 16, 186, 0, -1, 1, '321000100', 'SDSFSF', 'AAA', 12.5, 0, 1, 2, 1, 0, 16, '2014-05-28 07:52:13', 0, '2014-08-19 01:29:43'),
(20, 16, 186, 0, 3, 4, '331000100', 'labu sayong dibuat daripada tanah liat', 'loo kok ilang', 1, 12, 5, 2, 12, 5, 16, '2014-05-28 07:52:55', 0, '2014-08-19 01:29:28'),
(21, 17, 187, 0, 4, 7, '331000200', 'jackfruit', 'Buah', 1, 11, 5, 2, 11, 5, 16, '2014-05-28 08:05:33', 0, '2014-07-16 01:23:41'),
(22, 18, 176, 0, 2, 2, '100300100', 'kelapa muda hijau', 'kelapa', 1, 11, 5, 2, 11, 5, 16, '2014-05-28 08:19:27', 0, '2014-07-14 05:15:49'),
(24, 20, 188, 0, 3, 4, '331000100', 'labu sayong dibuat daripada tanah liat', 'loo kok ilang', 1, 12, 1, 2, 12, 1, 16, '2014-05-28 08:21:40', 0, '2014-08-19 01:29:28'),
(25, 21, 174, 0, 4, 7, '331000200', 'jackfruit', 'Buah', 1, 11, 5, 2, 11, 5, 16, '2014-05-28 08:24:02', 0, '2014-07-14 05:06:55'),
(26, 21, 175, 0, -1, 1, '321000100', 'SDSFSF', 'AAA', 10, 13, 12, 2, 12, 3, 16, '2014-05-28 08:24:16', 0, '2014-08-19 01:29:43'),
(27, 22, 188, 0, -1, 1, '321000100', 'SDSFSF', 'AAA', 9, 22, 11, 2, 11, 11, 16, '2014-05-28 08:31:14', 0, '2014-07-16 01:24:56'),
(28, 23, 189, 0, 2, 2, '100300100', 'kelapa muda hijau', 'kelapa', 1, 11, 5, 2, 11, 5, 16, '2014-05-28 08:32:30', 0, '2014-07-16 01:29:14'),
(30, 24, 190, 0, 3, 4, '331000100', 'labu sayong dibuat daripada tanah liat', 'loo kok ilang', 1, 12, 1, 2, 12, 1, 16, '2014-05-28 08:33:22', 0, '2014-07-16 01:43:57'),
(31, 25, 190, 0, 2, 2, '100300100', 'kelapa muda hijau', 'kelapa', 1, 11, 5, 2, 11, 5, 16, '2014-05-29 07:14:24', 0, '2014-07-16 01:43:57'),
(32, 25, 192, 0, -1, 9, '501012000', 'sadd', 'NGA', 12, 0, 122, 2, 1464, 0, 16, '2014-05-29 07:15:04', 16, '2014-08-18 11:05:37'),
(33, 26, 192, 0, 3, 4, '331000100', 'labu sayong dibuat daripada tanah liat', 'loo kok ilang', 1, 12, 1, 2, 12, 1, 16, '2014-05-29 07:23:51', 0, '2014-07-16 02:11:05'),
(34, 26, 194, 0, -1, 1, '321000100', 'SDSFSF', 'AAA', 13, 2, 1, 2, 1, 1, 16, '2014-05-29 07:24:19', 0, '2014-07-17 00:33:33'),
(35, 27, 194, 0, 4, 7, '331000200', 'jackfruit', 'Buah', 1, 11, 1, 2, 11, 1, 16, '2014-05-29 08:04:01', 0, '2014-07-17 00:33:33'),
(36, 28, 194, 0, 4, 7, '331000200', 'jackfruit', 'Buah', 1, 11, 1, 2, 11, 1, 16, '2014-05-29 08:06:57', 0, '2014-07-17 00:33:33'),
(37, 28, 195, 0, 2, 2, '100300100', 'kelapa muda hijau', 'kelapa', 1, 11, 1, 2, 11, 1, 16, '2014-05-29 08:07:09', 0, '2014-07-17 00:35:51'),
(39, 29, 195, 0, 4, 7, '331000200', 'jackfruit', 'Buah', 1, 11, 1, 2, 11, 1, 16, '2014-05-29 10:57:01', 0, '2014-07-17 00:35:51'),
(40, 29, 196, 0, -1, 1, '321000100', 'SDSFSF', 'AAA', 12, 23, 21, 2, 252, 21, 16, '2014-05-29 10:57:27', 0, '2014-07-17 05:40:09'),
(41, 30, 0, 0, 3, 4, '331000100', 'labu sayong dibuat daripada tanah liat', 'loo kok ilang', 1, 12, 1, 2, 12, 1, 16, '2014-05-29 11:06:33', 0, '2014-07-07 01:39:03'),
(44, 32, 182, 0, 14, 11, 'M001', 'saiz 10. warna gold', 'Meja makan bulat', 125, 5, 5, 2, 625, 5, 16, '2014-06-11 05:10:38', 0, '2014-07-16 00:27:26'),
(45, 32, 182, 0, 15, 11, 'M001', 'saiz 10. warna gold', 'Meja makan bulat', 100, 1, 1, 2, 100, 1, 16, '2014-06-11 05:10:47', 0, '2014-07-16 00:27:26'),
(46, 0, 0, 0, 16, 12, 'M002', 'saiz 10. warna hitam', 'Meja makan lonjong', 250, 1, 1, 2, 250, 0, 16, '2014-06-11 05:10:48', 0, '2014-07-01 04:12:13'),
(47, 33, 0, 0, 17, 11, 'M001', 'saiz 10. warna gold', 'Meja makan bulat', 100, 5, 5, 2, 500, 5, 16, '2014-06-12 09:43:40', 0, '2014-07-09 04:34:17'),
(48, 33, 0, 0, 18, 12, 'M002', 'saiz 10. warna hitam', 'Meja makan lonjong', 125, 1, 1, 2, 125, 1, 16, '2014-06-12 09:43:50', 0, '2014-07-09 04:34:17'),
(52, 37, 196, 0, 28, 1, '321000100', '', 'Teak wooden chair with natural finish', 12, 24, 12, 2, 144, 12, 16, '2014-06-24 06:45:36', 0, '2014-07-17 05:40:09'),
(53, 38, 0, 0, 2, 2, '100300100', 'kelapa muda hijau', 'kelapa', 1, 11, 1, 2, 11, 0, 16, '2014-06-24 08:25:19', 0, '2014-07-01 04:12:13'),
(54, 39, 0, 1, -1, 7, '331000200', '0', 'Plastic Chair - Red', 2345, 0, 12, 2, 28140, 12, 16, '2014-06-24 09:23:56', 0, '2014-07-07 01:39:03'),
(57, 41, 180, 1, -1, 4, '331000100', '0', 'Plastic Chair - Blue', 12, 0, 2, 2, 24, 2, 16, '2014-06-24 09:41:19', 0, '2014-08-19 01:29:27'),
(60, 0, 0, 0, 12, 4, '331000100', 'labu sayong dibuat daripada tanah liat', 'loo kok ilang', 22, 22, 1, 2, 484, 1, 16, '2014-06-24 09:48:04', 0, '2014-08-19 01:22:21'),
(64, 45, 0, 1, 13, 1, '321000100', '0', 'fad', 12, 1, 1, 2, 12, 1, 16, '2014-06-25 00:48:52', 0, '2014-08-18 11:05:48'),
(65, 45, 0, 0, -1, 1, '321000100', '0', 'Nasi Goreng Ayam', 12, 0, 12, 2, 144, 12, 16, '2014-06-25 00:49:14', 0, '2014-08-18 11:05:47'),
(66, 46, 0, 1, 9, 1, '321000100', '0', 'kelapa', 1, 12, 1, 2, 12, 1, 16, '2014-06-25 02:03:10', 0, '2014-08-18 11:05:47'),
(73, 49, 0, 1, -1, 4, '331000100', '0', 'Plastic Chair - Blue', 12, 0, 2, 2, 24, 2, 16, '2014-06-25 02:26:19', 0, '2014-08-19 01:22:21'),
(78, 52, 0, 1, 25, 10, '801010001', '0', 'Teak wooden chair with natural finish', 1, 1, 1, 2, 1, 0, 16, '2014-06-25 05:21:54', 0, '2014-07-07 01:39:03'),
(79, 52, 0, 0, -1, 7, '331000200', '', 'Plastic Chair - Red', 2345, 0, 1, 2, 2345, 1, 16, '2014-06-25 05:22:24', 0, '2014-07-07 01:39:03'),
(80, 52, 0, 0, -1, 7, '331000200', '', 'Plastic Chair - Red', 2345, 0, 1, 2, 2345, 1, 16, '2014-06-25 05:22:26', 0, '2014-07-07 01:39:03'),
(81, 52, 0, 0, -1, 7, '331000200', '', 'Plastic Chair - Red', 2345, 0, 1, 2, 2345, 1, 16, '2014-06-25 05:23:08', 0, '2014-07-07 01:39:03'),
(82, 53, 0, 1, 23, 1, '321000100', '0', 'Teak wooden chair with natural finish', 1, 2, 1, 2, 12, 1, 16, '2014-06-25 05:24:09', 16, '2014-07-07 01:39:03'),
(83, 53, 0, 0, -1, 8, '331000300', '', 'Plastic Chair - White', 12, 0, 20, 2, 24, 14, 16, '2014-06-25 05:27:03', 0, '2014-08-19 01:22:21'),
(85, 54, 0, 0, 9, 2, '100300100', '', 'kelapa', 1, 12, 1, 2, 12, 0, 16, '2014-06-25 06:03:17', 0, '2014-07-07 01:39:03'),
(86, 0, 0, 0, -1, 1, '321000100', '', 'Teak wooden chair with natural finish', 12, 24, 12, 2, 144, 12, 16, '2014-06-25 06:03:30', 0, '2014-07-07 01:39:03'),
(87, 0, 0, 0, -1, 7, '331000200', '', 'Plastic Chair - Red', 2345, 0, 1, 2, 2345, 1, 16, '2014-06-25 06:03:38', 0, '2014-07-07 01:39:03'),
(88, 0, 0, 0, -1, 4, '331000100', '', 'Plastic Chair - Blue', 12, 0, 2, 2, 24, 2, 16, '2014-06-25 06:04:15', 0, '2014-08-19 01:22:21'),
(89, 55, 0, 1, -1, 7, '331000200', '0', 'Plastic Chair - Red', 2345, 0, 1, 2, 2345, 1, 16, '2014-06-25 06:04:50', 0, '2014-07-07 01:39:03'),
(90, 56, 0, 1, 29, 4, '331000100', '0', 'Plastic Chair - Blue', 1212, 12, 1, 2, 14544, 1, 16, '2014-06-25 06:06:09', 0, '2014-08-19 01:22:21'),
(91, 56, 0, 0, 30, 10, '801010001', '', 'Bola Tampar Buaya', 111, 12, 1, 2, 1332, 0, 16, '2014-06-25 06:06:13', 0, '2014-07-07 01:39:03'),
(92, 0, 0, 0, -1, 7, '331000200', '', 'Plastic Chair - Red', 2345, 0, 1, 2, 2345, 1, 16, '2014-06-25 06:06:39', 0, '2014-07-07 01:39:03'),
(93, 0, 0, 0, -1, 7, '331000200', '', 'Plastic Chair - Red', 2345, 0, 1, 2, 2345, 1, 16, '2014-06-25 06:06:52', 0, '2014-07-07 01:39:03'),
(94, 0, 0, 0, -1, 7, '331000200', '', 'Plastic Chair - Red', 2345, 0, 1, 2, 2345, 1, 16, '2014-06-25 06:09:43', 0, '2014-07-07 01:39:03'),
(95, 57, 0, 1, -1, 4, '331000100', '0', 'Plastic Chair - Blue', 1, 0, 9, 2, 9, 9, 16, '2014-06-25 06:10:38', 16, '2014-08-19 01:22:21'),
(98, 0, 0, 0, -1, 4, '331000100', '', 'Plastic Chair - Blue', 1, 0, 1, 2, 1, 1, 16, '2014-06-25 06:12:32', 0, '2014-08-19 01:22:12'),
(103, 59, 0, 1, 29, 4, '331000100', '0', 'Plastic Chair - Blue', 1212, 12, 1, 2, 14544, 1, 16, '2014-06-25 06:38:17', 0, '2014-08-19 01:22:12'),
(104, 59, 0, 0, 30, 10, '801010001', '', 'Bola Tampar Buaya', 111, 12, 1, 2, 1332, 0, 16, '2014-06-25 06:38:43', 0, '2014-07-07 01:39:03'),
(107, 60, 0, 1, -1, 7, '331000200', '0', 'Plastic Chair - Red', 1, 0, 1, 2, 1, 1, 16, '2014-06-25 06:43:07', 16, '2014-07-07 01:39:03'),
(108, 60, 0, 2, -1, 7, '331000200', '', 'Plastic Chair - Red', 1, 0, 1, 2, 1, 1, 16, '2014-06-25 06:43:14', 16, '2014-07-08 03:12:01'),
(109, 61, 0, 1, 29, 4, '331000100', '', 'Plastic Chair - Blue', 1212, 12, 1, 2, 14544, 1, 16, '2014-06-26 01:56:34', 0, '2014-08-19 01:22:12'),
(110, 61, 0, 1, -1, 7, '331000200', '', 'Plastic Chair - Red', 2345, 0, 12, 2, 28140, 12, 16, '2014-06-26 01:57:01', 16, '2014-07-07 01:39:03'),
(111, 62, 183, 1, 31, 11, 'M001', '', 'saiz 10. warna gold', 2, 10, 1, 2, 20, 10, 16, '2014-07-02 08:10:27', 0, '2014-07-16 00:35:38'),
(112, 62, 185, 2, 32, 12, 'M002', '', 'saiz 10. warna merah', 3, 5, 1, 2, 15, 5, 16, '2014-07-02 08:10:32', 0, '2014-07-16 01:14:00'),
(113, 63, 0, 1, 8, 2, '100300100', '', 'kelapa', 1, 22, 1, 2, 22, 0, 16, '2014-07-03 09:06:26', 0, '2014-07-09 04:50:48'),
(114, 64, 0, 1, 8, 2, '100300100', '', 'kelapa', 1, 22, 1, 2, 22, 0, 16, '2014-07-03 09:10:37', 0, '2014-07-09 04:50:48'),
(115, 65, 0, 1, 22, 1, '321000100', '', 'Teak wooden chair with natural finish', 1, 12, 1, 2, 12, 1, 16, '2014-07-03 09:13:03', 0, '2014-08-18 11:05:47'),
(116, 66, 0, 1, -1, 7, '331000200', '', 'Plastic Chair - Red', 2345, 0, 1, 2, 2345, 1, 16, '2014-07-03 09:15:13', 0, '2014-08-18 11:28:50'),
(117, 67, 0, 1, -1, 1, '321000100', '', 'Teak wooden chair with natural finish', 1, 0, 12, 2, 12, 12, 16, '2014-07-03 09:16:18', 0, '2014-08-18 11:05:47'),
(121, 60, 0, 5, -1, 1, '', '', 'Teak wooden chair with natural finish', 10, 0, 1, 2, 10, 1, 16, '2014-07-08 01:19:00', 0, '2014-08-18 11:05:41'),
(122, 60, 0, 6, -1, 1, '', '', 'Teak wooden chair with natural finish', 0, 0, 1, 2, 0, 1, 16, '2014-07-08 01:20:42', 0, '2014-08-18 11:05:41'),
(137, 60, 0, 7, -1, 1, '', '', 'Teak wooden chair with natural finish', 1, 0, 1, 2, 1, 1, 16, '2014-07-08 01:58:29', 0, '2014-08-18 11:05:41'),
(138, 60, 0, 8, -1, 1, '', '', 'Teak wooden chair with natural finish', 0, 0, 0, 2, 0, 0, 16, '2014-07-08 02:01:15', 0, '2014-07-09 04:50:48'),
(139, 60, 0, 9, -1, 1, '', '', 'Teak wooden chair with natural finish', 10, 0, 1, 2, 10, 1, 16, '2014-07-08 02:16:26', 0, '2014-08-18 11:05:41'),
(140, 60, 0, 10, -1, 1, '', '', 'Teak wooden chair with natural finish', 1, 0, 1, 2, 1, 1, 16, '2014-07-08 02:19:14', 0, '2014-08-18 11:05:37'),
(141, 60, 0, 11, -1, 1, '', '', 'Teak wooden chair with natural finish', 1, 0, 1, 2, 1, 1, 16, '2014-07-08 02:20:03', 16, '2014-08-18 11:05:37'),
(145, 60, 0, 1, 29, 4, '', '', 'Plastic Chair - Blue', 1212, 12, 1, 2, 14544, 1, 16, '2014-07-08 03:14:42', 0, '2014-08-19 01:22:12'),
(147, 60, 0, 3, 29, 4, '', '', 'Plastic Chair - Blue', 1212, 12, 1, 2, 14544, 1, 16, '2014-07-08 03:15:34', 0, '2014-08-19 01:22:12'),
(148, 68, 0, 1, 44, 1, '', '', 'Teak wooden chair with natural finish', 0, 10, 10, 2, 0, 10, 1, '2014-07-09 02:52:02', 0, '2014-08-18 11:05:36'),
(149, 68, 201, 2, 46, 13, '', '', 'ALATAN TULIS DAN MELUKIS', 2, 15, 10, 2, 30, 0, 1, '2014-07-09 02:52:08', 0, '2014-07-24 03:55:07'),
(150, 69, 201, 1, 46, 13, '', '', 'ALATAN TULIS DAN MELUKIS', 2, 15, 5, 2, 30, 0, 1, '2014-07-09 03:10:25', 0, '2014-07-24 03:55:07'),
(151, 69, 201, 2, 45, 13, '', '', 'ALATAN TULIS DAN MELUKIS', 0, 10, 5, 2, 0, 0, 1, '2014-07-09 03:10:27', 0, '2014-07-24 03:55:07'),
(152, 70, 0, 1, 33, 11, '', '', 'saiz 10. warna gold', 2, 2, 2, 0, 4, 0, 16, '2014-07-09 04:58:31', 0, '0000-00-00 00:00:00'),
(153, 71, 191, 1, 47, 11, '', '', 'saiz 10. warna gold', 2222, 1, 1, 0, 2222, 0, 16, '2014-07-10 03:39:35', 0, '2014-07-16 02:10:14'),
(154, 71, 193, 2, 48, 12, '', '', 'saiz 10. warna hitam', 3333, 12, 4, 0, 39996, 0, 16, '2014-07-10 03:45:52', 0, '2014-07-16 02:11:51'),
(155, 71, 191, 1, -1, 11, '', '', 'saiz 10. warna gold', 0, 0, 1, 0, 0, 0, 16, '2014-07-10 03:46:59', 0, '2014-07-16 02:10:14'),
(156, 72, 0, 1, 49, 16, '', '', 'Wireless', 110, 10, 5, 0, 1100, 0, 29, '2014-07-21 07:00:59', 0, '0000-00-00 00:00:00'),
(157, 73, 0, 1, 54, 8, '', '', 'Plastic Chair - White', 12, 1, 1, 0, 12, 1, 1, '2014-07-31 02:21:14', 0, '2014-08-19 01:22:12'),
(158, 74, 0, 1, 54, 8, '', '', 'Plastic Chair - White', 12, 1, 1, 0, 12, 1, 1, '2014-07-31 02:21:18', 0, '2014-08-19 01:22:12'),
(159, 75, 0, 1, 54, 8, '', '', 'Plastic Chair - White', 12, 1, 1, 0, 12, 1, 1, '2014-07-31 02:21:23', 0, '2014-08-18 11:30:33'),
(160, 73, 0, 1, -1, 1, '', '', 'Teak wooden chair with natural finish', 12, 0, 2, 0, 24, 2, 1, '2014-07-31 02:22:03', 0, '2014-08-18 10:50:19'),
(161, 76, 207, 1, 56, 18, '', '', 'Dell High Specification', 100, 5, 5, 0, 500, 0, 29, '2014-08-04 03:14:32', 0, '2014-08-05 01:23:47'),
(162, 76, 0, 1, -1, 16, '', '', 'Wireless', 100, 0, 5, 0, 500, 0, 29, '2014-08-04 03:15:03', 0, '0000-00-00 00:00:00'),
(163, 77, 207, 1, 58, 17, '', '', 'Projector 1 set with remote', 34, 5, 3, 0, 170, 0, 16, '2014-08-04 10:11:56', 0, '2014-08-05 01:23:47'),
(164, 78, 0, 1, 59, 18, '', '', 'Dell High Specification', 34, 5, 4, 0, 170, 0, 33, '2014-08-05 04:24:42', 0, '0000-00-00 00:00:00'),
(167, 78, 0, 4, 59, 18, '', '', 'Dell High Specification', 34, 5, 3, 0, 170, 0, 33, '2014-08-05 04:47:17', 0, '0000-00-00 00:00:00'),
(169, 79, 0, 1, 60, 0, '', '', 'description', 34, 8, 5, 0, 272, 0, 33, '2014-08-05 09:31:07', 0, '0000-00-00 00:00:00'),
(170, 80, 0, 1, 60, 0, '', '', 'description', 34, 8, 2, 0, 272, 0, 33, '2014-08-05 09:31:57', 0, '0000-00-00 00:00:00'),
(171, 79, 0, 2, 60, 0, '', '', 'description', 34, 8, 1, 0, 272, 0, 33, '2014-08-05 09:32:45', 0, '0000-00-00 00:00:00'),
(172, 81, 0, 1, 61, 19, '', '', 'New Item description', 34, 20, 5, 0, 680, 0, 33, '2014-08-06 03:10:31', 0, '0000-00-00 00:00:00');

--
-- Triggers `comp_receive_item_detail`
--
DROP TRIGGER IF EXISTS `updateBalanceItem`;
DELIMITER //
CREATE TRIGGER `updateBalanceItem` BEFORE INSERT ON `comp_receive_item_detail`
 FOR EACH ROW if new.balanceitem is null then
set new.balanceItem = new.quantityReceived;
end if
//
DELIMITER ;

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

--
-- Table structure for table `comp_receive_payment`
--

CREATE TABLE IF NOT EXISTS `comp_receive_payment` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `serialNo` int(11) NOT NULL DEFAULT '1',
  `companyID` int(11) NOT NULL,
  `customerID` int(11) NOT NULL,
  `projectID` int(11) NOT NULL,
  `paymentMethodID` int(11) NOT NULL,
  `referenceNo` int(11) NOT NULL,
  `bankID` int(11) NOT NULL,
  `accountID` int(11) NOT NULL,
  `formNo` varchar(32) NOT NULL,
  `receivePaymentDate` date NOT NULL,
  `currencyID` int(11) NOT NULL,
  `exchangeRate` double NOT NULL,
  `addressID` int(11) NOT NULL,
  `memo` text NOT NULL,
  `totalDiscount` double NOT NULL,
  `bankCharges` double NOT NULL,
  `totalOtherCharge` double NOT NULL,
  `totalReceived` double NOT NULL,
  `totalApplied` double NOT NULL,
  `outOfBalance` double NOT NULL,
  `updateAble` smallint(1) 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` smallint(6) NOT NULL DEFAULT '0',
  `journalNo` varchar(32) NOT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=31 ;

--
-- Dumping data for table `comp_receive_payment`
--

INSERT INTO `comp_receive_payment` (`ID`, `serialNo`, `companyID`, `customerID`, `projectID`, `paymentMethodID`, `referenceNo`, `bankID`, `accountID`, `formNo`, `receivePaymentDate`, `currencyID`, `exchangeRate`, `addressID`, `memo`, `totalDiscount`, `bankCharges`, `totalOtherCharge`, `totalReceived`, `totalApplied`, `outOfBalance`, `updateAble`, `createdBy`, `createdTS`, `updatedBy`, `updatedTS`, `is_delete`, `journalNo`) VALUES
(8, 1, 16, 12, 17, 69, 121, 0, 101, 'PP20140617', '2014-06-17', 1, 1, 0, '', 242, 21, -221, 0, 20000, 12101433, 0, 16, '2014-06-17 10:50:32', 0, '2014-06-26 08:19:27', 0, 'AR20140600000001'),
(9, 1, 1, 12, 17, 69, 121, 0, 101, 'PP20140617', '2014-06-17', 1, 1, 0, '', 242, 21, -221, 0, 20000, 12101433, 1, 16, '2014-06-17 10:56:34', 0, '2014-06-17 12:21:02', 0, ''),
(10, 1, 1, 12, 1, 69, 212, 0, 101, 'PP20140617', '2014-06-17', 1, 3, 0, 'sds', 0, 0, 0, 0, 20000, 1191900, 1, 16, '2014-06-17 12:10:23', 0, '2014-06-26 04:43:10', 0, ''),
(11, 1, 1, 12, 1, 69, 212, 0, 101, 'PP20140617', '2014-06-17', 1, 3, 0, 'sds', 0, 0, 0, 0, 20000, 1191900, 1, 16, '2014-06-17 12:10:28', 0, '2014-06-26 04:43:10', 0, ''),
(12, 1, 1, 12, 1, 69, 212, 0, 101, 'PP20140617', '2014-06-17', 1, 3, 0, 'sds', 0, 0, 0, 0, 20000, 1191900, 1, 16, '2014-06-17 12:10:29', 0, '2014-06-26 04:43:11', 0, ''),
(13, 1, 1, 12, 1, 69, 0, 0, 101, 'PP20140617', '2014-06-18', 1, 1, 0, '', 0, 0, 0, 0, 10000, -9577, 1, 16, '2014-06-17 12:13:35', 0, '2014-07-04 01:38:49', 0, ''),
(14, 1, 1, 12, 1, 69, 0, 0, 101, 'PP20140617', '2014-06-17', 1, 1, 0, '', 0, 0, 0, 0, 10000, -9577, 1, 16, '2014-06-17 12:13:42', 0, '2014-06-26 04:43:12', 0, ''),
(15, 1, 1, 12, 1, 69, 0, 0, 101, 'PP20140617', '2014-06-17', 1, 1, 0, '', 0, 0, 0, 0, 10000, -9577, 1, 16, '2014-06-17 12:13:44', 0, '2014-06-26 04:43:12', 0, ''),
(16, 1, 1, 12, 1, 69, 0, 0, 101, 'PP20140617', '2014-06-17', 1, 1, 0, '', 0, 0, 0, 0, 10000, -9577, 1, 16, '2014-06-17 12:13:47', 0, '2014-06-26 04:43:13', 0, ''),
(17, 1, 1, 12, 1, 68, 0, 0, 0, 'PP20140627', '2014-06-27', 1, 3.1305, 0, '', 1, 0, -1, 0, 2509.44, 11999493.56, 0, 16, '2014-06-27 02:30:38', 0, '0000-00-00 00:00:00', 0, ''),
(18, 1, 1, 12, 1, 68, 0, 0, 0, 'PP20140627', '2014-06-27', 1, 3.1305, 0, '', 1, 0, -1, 0, 2509.44, 11999493.56, 0, 16, '2014-06-27 02:30:46', 0, '0000-00-00 00:00:00', 0, ''),
(19, 1, 1, 12, 1, 68, 0, 0, 0, 'PP20140627', '2014-06-27', 1, 3.1305, 0, '', 0, 0, 0, 0, 1, 9, 0, 16, '2014-06-27 02:33:52', 0, '0000-00-00 00:00:00', 0, ''),
(20, 1, 1, 15, 1, 68, 0, 0, 0, 'PP20140627', '2014-06-11', 2, 3.1305, 0, 'sdsdfq', 0, 0, 0, 0, 12, 18977, 0, 16, '2014-06-27 07:18:03', 0, '0000-00-00 00:00:00', 0, ''),
(21, 1, 1, 15, 1, 68, 0, 0, 0, 'PP20140627', '2014-06-11', 2, 3.1305, 0, 'sdsdfq', 0, 0, 0, 0, 0, 18989, 0, 16, '2014-06-27 07:20:18', 0, '0000-00-00 00:00:00', 0, ''),
(22, 1, 1, 12, 1, 68, 0, 0, 0, 'PP20140627', '2014-06-24', 1, 3.1305, 0, 'qwq', 0, 0, 0, 0, 1.01, 1219.99, 0, 16, '2014-06-27 07:24:55', 0, '0000-00-00 00:00:00', 0, ''),
(23, 1, 1, 12, 2, 68, 1, 12, 0, 'PP20140627', '2014-06-24', 1, 3.1305, 0, 'asa', 11, 0, -11, 0, 3.16, 1218.84, 0, 16, '2014-06-27 07:28:48', 0, '0000-00-00 00:00:00', 0, ''),
(24, 1, 1, 12, 17, 68, 0, 12, 0, 'PP20140627', '2014-06-23', 1, 3.1305, 0, '23', 0, 0, 0, 0, 2, -12, 0, 16, '2014-06-27 07:38:00', 0, '0000-00-00 00:00:00', 0, ''),
(25, 1, 1, 15, 1, 68, 12, 12, 0, 'PP20140627', '2014-06-11', 2, 3.1305, 0, 'sds', 2, 1, -1, 0, 2, 3, 0, 16, '2014-06-27 07:49:42', 0, '0000-00-00 00:00:00', 0, ''),
(26, 1, 1, 16, 1, 68, 0, 12, 0, 'PP20140630', '1970-01-01', 1, 3.1305, 0, 'sds', 1, 0, -1, 0, 1, 2, 0, 16, '2014-06-30 03:57:14', 0, '0000-00-00 00:00:00', 0, ''),
(27, 1, 1, 12, 10, 69, 121, 12, 0, 'PP20140630', '1970-01-01', 1, 3.1305, 0, 'awq', 1, 0, -1, 0, 1, 2, 0, 16, '2014-06-30 04:00:22', 0, '0000-00-00 00:00:00', 0, ''),
(28, 1, 1, 12, 10, 68, 0, 12, 0, 'PP20140630', '1970-01-01', 1, 3.1305, 0, 'asa', 11, 0, -11, 2008, 13, 0, 0, 16, '2014-06-30 04:02:31', 0, '2014-07-01 08:18:11', 0, ''),
(29, 1, 1, 12, 1, 68, 0, 12, 0, 'PP20140630', '1970-01-01', 1, 3.1305, 0, 'asax', 2, 0, -2, 0, 4, 8, 0, 16, '2014-06-30 04:51:01', 0, '0000-00-00 00:00:00', 0, ''),
(30, 1, 1, 12, 17, 68, 0, 12, 0, 'PP20140630', '1970-01-01', 1, 3.1305, 0, 'dsmf sdldf,a', 13, 1, -12, 1111, 2, 0, 0, 16, '2014-06-30 05:01:25', 0, '2014-07-01 01:42:58', 0, '');

--
-- Triggers `comp_receive_payment`
--
DROP TRIGGER IF EXISTS `trigger_before_insert_rpay_add_serialNo`;
DELIMITER //
CREATE TRIGGER `trigger_before_insert_rpay_add_serialNo` BEFORE INSERT ON `comp_receive_payment`
 FOR EACH ROW set new.serialNo = (select nextSerialNo 
			   from view_serial_comp_receive_payment
			   where companyID = new.companyID)
//
DELIMITER ;

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

--
-- Table structure for table `comp_receive_payment_detail`
--

CREATE TABLE IF NOT EXISTS `comp_receive_payment_detail` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `receivePaymentID` int(11) NOT NULL,
  `lineNo` int(11) NOT NULL,
  `invoiceID` int(11) NOT NULL,
  `totalAmount` double NOT NULL,
  `ARBalance` double NOT NULL,
  `discount` double NOT NULL,
  `amountApplied` double NOT NULL,
  `createdBy` int(11) NOT NULL,
  `createdTS` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `updatedBy` int(11) NOT NULL,
  `updatedTS` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=41 ;

--
-- Dumping data for table `comp_receive_payment_detail`
--

INSERT INTO `comp_receive_payment_detail` (`ID`, `receivePaymentID`, `lineNo`, `invoiceID`, `totalAmount`, `ARBalance`, `discount`, `amountApplied`, `createdBy`, `createdTS`, `updatedBy`, `updatedTS`) VALUES
(1, 8, 0, 18, 0, 0, 121, 10000, 0, '2014-06-26 07:12:55', 0, '0000-00-00 00:00:00'),
(2, 8, 0, 19, 0, 0, 121, 10000, 0, '2014-06-26 07:14:52', 0, '0000-00-00 00:00:00'),
(3, 10, 0, 18, 0, 0, 0, 10000, 0, '2014-07-03 01:21:11', 0, '0000-00-00 00:00:00'),
(4, 10, 0, 19, 0, 0, 0, 10000, 0, '2014-07-03 01:22:59', 0, '0000-00-00 00:00:00'),
(5, 11, 0, 0, 0, 0, 0, 10000, 0, '2014-06-17 12:10:28', 0, '0000-00-00 00:00:00'),
(6, 11, 0, 0, 0, 0, 0, 10000, 0, '2014-06-17 12:10:28', 0, '0000-00-00 00:00:00'),
(7, 12, 0, 0, 0, 0, 0, 10000, 0, '2014-06-17 12:10:29', 0, '0000-00-00 00:00:00'),
(8, 12, 0, 0, 0, 0, 0, 10000, 0, '2014-06-17 12:10:29', 0, '0000-00-00 00:00:00'),
(9, 13, 0, 0, 0, 0, 0, 10000, 0, '2014-06-17 12:13:35', 0, '0000-00-00 00:00:00'),
(10, 14, 0, 0, 0, 0, 0, 10000, 0, '2014-07-03 01:21:00', 0, '0000-00-00 00:00:00'),
(11, 15, 0, 0, 0, 0, 0, 10000, 0, '2014-06-17 12:13:44', 0, '0000-00-00 00:00:00'),
(12, 16, 0, 0, 0, 0, 0, 10000, 0, '2014-06-17 12:13:48', 0, '0000-00-00 00:00:00'),
(13, 17, 0, 18, 0, 0, 1, 2509.44, 0, '2014-06-27 02:30:38', 0, '0000-00-00 00:00:00'),
(14, 18, 0, 18, 0, 0, 1, 2509.44, 0, '2014-06-27 02:30:46', 0, '0000-00-00 00:00:00'),
(15, 19, 0, 19, 0, 0, 0, 1, 0, '2014-06-27 02:33:52', 0, '0000-00-00 00:00:00'),
(16, 20, 0, 20, 0, 0, 0, 12, 0, '2014-06-27 07:18:03', 0, '0000-00-00 00:00:00'),
(17, 22, 0, 21, 0, 0, 0, 1.01, 0, '2014-06-27 07:24:55', 0, '0000-00-00 00:00:00'),
(18, 23, 0, 22, 0, 0, 11, 3.16, 0, '2014-06-27 07:28:48', 0, '0000-00-00 00:00:00'),
(19, 24, 0, 23, 0, 0, 0, 1, 0, '2014-06-27 07:38:01', 0, '0000-00-00 00:00:00'),
(20, 24, 0, 24, 0, 0, 0, 1, 0, '2014-06-27 07:38:01', 0, '0000-00-00 00:00:00'),
(21, 25, 1, 26, 0, 0, 1, 1, 0, '2014-06-27 07:49:42', 0, '0000-00-00 00:00:00'),
(22, 25, 2, 27, 0, 0, 1, 1, 0, '2014-06-27 07:49:42', 0, '0000-00-00 00:00:00'),
(23, 26, 1, 32, 0, 0, 1, 1, 0, '2014-06-30 03:57:14', 0, '0000-00-00 00:00:00'),
(24, 27, 1, 30, 0, 0, 1, 1, 0, '2014-06-30 04:00:22', 0, '0000-00-00 00:00:00'),
(28, 28, 4, 30, 0, 0, 11, 0, 0, '2014-07-01 05:20:23', 0, '0000-00-00 00:00:00'),
(29, 28, 5, 31, 0, 0, 0, 12, 0, '2014-07-01 05:20:34', 0, '0000-00-00 00:00:00'),
(30, 29, 1, 28, 0, 0, 1, 1, 0, '2014-06-30 04:51:01', 0, '0000-00-00 00:00:00'),
(31, 29, 2, 29, 0, 0, 0, 1, 0, '2014-06-30 04:51:01', 0, '0000-00-00 00:00:00'),
(32, 29, 3, 30, 0, 0, 0, 1, 0, '2014-06-30 04:51:01', 0, '0000-00-00 00:00:00'),
(33, 29, 4, 31, 0, 0, 1, 1, 0, '2014-06-30 04:51:01', 0, '0000-00-00 00:00:00'),
(34, 30, 1, 28, 0, 0, 0, 1, 0, '2014-07-01 01:42:58', 0, '0000-00-00 00:00:00'),
(35, 30, 2, 30, 0, 0, 12, 0, 0, '2014-07-01 01:30:42', 0, '0000-00-00 00:00:00'),
(36, 30, 3, 31, 0, 0, 1, 1, 0, '2014-06-30 05:01:26', 0, '0000-00-00 00:00:00'),
(37, 28, 6, 30, 0, 0, 0, 1, 0, '2014-07-01 08:15:41', 0, '0000-00-00 00:00:00'),
(39, 28, 7, 29, 0, 0, 0, 1, 0, '2014-07-01 08:18:47', 0, '0000-00-00 00:00:00'),
(40, 28, 8, 31, 0, 0, 0, 1, 0, '2014-07-01 08:18:47', 0, '0000-00-00 00:00:00');

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

--
-- Table structure for table `comp_sales_agent`
--

CREATE TABLE IF NOT EXISTS `comp_sales_agent` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `companyID` int(11) NOT NULL,
  `agentCode` varchar(32) NOT NULL,
  `agentName` varchar(128) NOT NULL,
  `position` varchar(32) NOT NULL,
  `telOffice` varchar(32) NOT NULL,
  `telHp` varchar(32) NOT NULL,
  `email` varchar(64) NOT NULL,
  `commisionRate` double NOT NULL,
  `remarks` text NOT NULL,
  `createdID` 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 AUTO_INCREMENT=18 ;

--
-- Dumping data for table `comp_sales_agent`
--

INSERT INTO `comp_sales_agent` (`ID`, `companyID`, `agentCode`, `agentName`, `position`, `telOffice`, `telHp`, `email`, `commisionRate`, `remarks`, `createdID`, `createdTS`, `updatedBy`, `updatedTS`) VALUES
(1, 1, '', 'sdsd', 'sdsd', '', '', '', 10, '', 0, '2014-06-09 07:15:56', 0, '2014-07-24 05:57:28'),
(2, 27, '', 'farhana', 'agent01', '', '', 'bee@gmail.com', 10, '', 0, '2014-06-10 02:15:27', 0, '2014-06-10 04:46:12'),
(5, 27, '', 'Aizat Jamil', 'Executive', '012 61778564', '012 61778564', 'aizat@salihin.com.my', 10, 'new agent', 0, '2014-06-10 07:02:36', 0, '0000-00-00 00:00:00'),
(6, 55, '', 'Wan Amin', 'Pengurus Rangkaian', '012 5678798', '012 5678798', 'amin@fabrica.com.my', 10, '', 0, '2014-07-03 01:59:23', 0, '0000-00-00 00:00:00'),
(7, 57, '', 'george', 'sales ', '012 5678767', '012 5678767', 'george@gmail.com', 10, '10% ', 0, '2014-07-09 02:16:34', 0, '0000-00-00 00:00:00'),
(8, 75, '', 'james bond', 'sales marketing', '0123234343', '0123234343', 'asdsd@salihin.com.my', 10, '', 0, '2014-07-17 04:17:25', 0, '0000-00-00 00:00:00'),
(9, 76, '', 'jimmy', 'marketing', '0125678767', '0125678767', 'jimmy@borong.com', 10, '', 0, '2014-07-17 04:17:39', 0, '0000-00-00 00:00:00'),
(10, 81, '', 'Munira Yasin', 'Marketing Manager', '0126767567', '0126767567', 'moon@gmail.com', 10, 'komisen 10% based on project basis', 0, '2014-07-21 02:06:51', 0, '2014-07-21 02:08:27'),
(11, 81, '', 'Miza Ahmad', 'Sales Consultant', '019 3456545', '019 3456545', 'miza@gmail.com', 10, 'komisen 10% on project basis', 0, '2014-07-21 02:08:09', 0, '0000-00-00 00:00:00'),
(12, 81, '', 'Farhana Zahari', 'Marketing', '603 61451245', '012 6666610', 'farhana@salihin.com.my', 10, 'project basis', 0, '2014-07-25 00:56:30', 0, '2014-07-25 01:00:42'),
(13, 84, '', 'Agent 1', 'Senior Executive', ' 603 61851515', '012 61851515', 'accounts@salihin.com.my', 5, 'Good', 0, '2014-08-05 01:40:52', 0, '0000-00-00 00:00:00'),
(14, 15, 'B-007', 'en fadhirul bond', 'manager', '', '', '', 10, '', 0, '2014-08-11 07:56:12', 0, '2014-08-14 08:44:35'),
(15, 1, '', 'robert', 'marketing ', '603 61887878', '012 5456546', 'robert@yahoo.com', 10, 'agent baru', 0, '2014-08-12 07:35:07', 0, '0000-00-00 00:00:00'),
(16, 86, '', 'Salman Khan', 'sales marketing', '', '012 8226466', 'salman@gmail.com', 10, 'Agent', 0, '2014-08-13 05:35:21', 0, '0000-00-00 00:00:00'),
(17, 86, '', 'Amir Khan', 'msrketing', '', '', '', 10, '', 0, '2014-08-13 07:38:08', 0, '0000-00-00 00:00:00');

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

--
-- Table structure for table `comp_sales_creditnote`
--

CREATE TABLE IF NOT EXISTS `comp_sales_creditnote` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `serialNo` int(11) NOT NULL DEFAULT '1',
  `companyID` int(11) NOT NULL,
  `customerID` int(11) NOT NULL,
  `formNo` varchar(32) NOT NULL,
  `creditNoteDate` date NOT NULL,
  `salesInvoiceID` int(11) NOT NULL,
  `projectID` int(11) NOT NULL,
  `termsID` int(11) NOT NULL,
  `currencyID` int(11) NOT NULL,
  `exchangeRate` double NOT NULL,
  `agentID` int(11) NOT NULL,
  `memo` text NOT NULL,
  `employeeID` int(11) NOT NULL,
  `shippingMethodID` int(11) NOT NULL,
  `totalAmount` double NOT NULL,
  `amountPaid` decimal(10,0) NOT NULL,
  `totalTaxAmount` double NOT NULL,
  `totalPayable` double NOT NULL,
  `total` 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` smallint(16) NOT NULL,
  `updateAble` tinyint(1) NOT NULL DEFAULT '1',
  `journalNo` varchar(32) NOT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=14 ;

--
-- Dumping data for table `comp_sales_creditnote`
--

INSERT INTO `comp_sales_creditnote` (`ID`, `serialNo`, `companyID`, `customerID`, `formNo`, `creditNoteDate`, `salesInvoiceID`, `projectID`, `termsID`, `currencyID`, `exchangeRate`, `agentID`, `memo`, `employeeID`, `shippingMethodID`, `totalAmount`, `amountPaid`, `totalTaxAmount`, `totalPayable`, `total`, `createdBy`, `createdTS`, `updatedBy`, `updatedTS`, `is_delete`, `updateAble`, `journalNo`) VALUES
(1, 1, 1, 12, 'CRN', '2014-06-04', 18, 0, 0, 1, 1, 0, '', 0, 0, 10000, '0', 600, 0, 0, 0, '2014-06-24 01:39:38', 0, '2014-06-24 01:41:34', 0, 1, ''),
(2, 1, 1, 12, 'SCN', '2014-07-02', 21, 17, 0, 0, 3.1305, 0, 'ergfwr', 0, 0, 0, '0', 0, 0, 0, 16, '2014-07-02 07:40:30', 0, '0000-00-00 00:00:00', 0, 1, ''),
(3, 1, 1, 12, 'SCN', '2014-07-02', 19, 1, 0, 0, 3.1305, 0, 'ewwew', 0, 0, 0, '0', 0, 0, 0, 16, '2014-07-02 07:47:10', 0, '0000-00-00 00:00:00', 0, 1, ''),
(4, 1, 1, 12, 'SCN', '2014-07-03', 18, 15, 0, 0, 3.1305, 0, 'ghf fhymf', 0, 0, 0, '0', 0, 0, 0, 16, '2014-07-03 01:25:05', 0, '2014-07-17 08:44:37', 0, 0, ''),
(5, 1, 1, 12, 'SCN', '2014-07-03', 18, 1, 0, 0, 3.1305, 0, '', 0, 0, 0, '0', 0, 0, 0, 16, '2014-07-03 01:30:10', 0, '0000-00-00 00:00:00', 0, 1, ''),
(6, 1, 1, 12, 'SCN', '2014-07-03', 18, 15, 0, 0, 3.1305, 0, '', 0, 0, 0, '0', 0, 0, 0, 16, '2014-07-03 04:02:06', 0, '0000-00-00 00:00:00', 0, 1, ''),
(7, 1, 1, 12, 'SCN', '2014-07-03', 18, 0, 0, 0, 3.1305, 0, '', 0, 0, 0, '0', 0, 0, 0, 16, '2014-07-03 04:06:00', 0, '0000-00-00 00:00:00', 0, 1, ''),
(8, 1, 1, 0, 'SCN', '2014-07-03', 0, 0, 0, 0, 0, 0, '', 0, 0, 0, '0', 0, 0, 0, 16, '2014-07-03 04:11:55', 0, '0000-00-00 00:00:00', 0, 1, ''),
(9, 1, 1, 12, 'SCN', '2014-07-03', 18, 10, 0, 0, 3.1305, 0, 'asda', 0, 0, 0, '0', 0, 0, 0, 16, '2014-07-03 04:14:29', 0, '0000-00-00 00:00:00', 0, 1, ''),
(10, 1, 1, 12, 'SCN', '2014-07-14', 18, 1, 0, 0, 3.1305, 0, 'asasda', 0, 0, 0, '0', 0, 0, 0, 16, '2014-07-14 02:09:30', 0, '0000-00-00 00:00:00', 0, 1, ''),
(11, 1, 1, 12, 'SCN', '2014-07-14', 18, 15, 5, 1, 3.1305, 0, 'fg dgst', 0, 0, 682.52, '0', 19.26, 0, 0, 16, '2014-07-14 02:15:35', 0, '2014-08-14 05:14:35', 0, 1, ''),
(12, 1, 1, 12, 'SCN', '2014-07-14', 18, 15, 0, 0, 3.1305, 0, 'sds', 0, 0, 356.44, '0', 19.44, 0, 0, 16, '2014-07-14 02:26:20', 0, '2014-07-14 03:08:55', 0, 1, ''),
(13, 2, 1, 12, 'SCN', '2014-08-14', 18, 1, 0, 0, 3.23, 0, '', 0, 0, 7825.98, '0', 442.98, 0, 0, 33, '2014-08-14 03:10:09', 0, '2014-08-14 03:10:09', 0, 1, '');

--
-- Triggers `comp_sales_creditnote`
--
DROP TRIGGER IF EXISTS `trigger_before_insert_scn_add_serialNo`;
DELIMITER //
CREATE TRIGGER `trigger_before_insert_scn_add_serialNo` BEFORE INSERT ON `comp_sales_creditnote`
 FOR EACH ROW set new.serialNo = (select nextSerialNo 
			   from view_serial_comp_sales_creditnote
			   where companyID = new.companyID)
//
DELIMITER ;

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

--
-- Table structure for table `comp_sales_creditnote_charges`
--

CREATE TABLE IF NOT EXISTS `comp_sales_creditnote_charges` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `creditNoteID` int(11) NOT NULL,
  `lineNo` int(11) NOT NULL,
  `accountNoID` int(11) NOT NULL,
  `chargeDescription` text NOT NULL,
  `amountExcludedTax` double NOT NULL,
  `taxID` int(11) NOT NULL,
  `taxRate` double NOT NULL,
  `taxAmount` double NOT NULL,
  `amountIncludedTax` double NOT NULL,
  `drAccountID` int(11) NOT NULL,
  `crAccountID` int(11) NOT NULL,
  `drTaxAccountID` int(11) NOT NULL,
  `crTaxAccountID` 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 '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=52 ;

--
-- Dumping data for table `comp_sales_creditnote_charges`
--

INSERT INTO `comp_sales_creditnote_charges` (`ID`, `creditNoteID`, `lineNo`, `accountNoID`, `chargeDescription`, `amountExcludedTax`, `taxID`, `taxRate`, `taxAmount`, `amountIncludedTax`, `drAccountID`, `crAccountID`, `drTaxAccountID`, `crTaxAccountID`, `createdBy`, `createdTS`, `updatedBy`, `updatedTS`) VALUES
(37, 18, 1, 86, 'delivery charges', 0, 9, 0, 0, 1212, 0, 0, 0, 0, 16, '2014-06-18 02:19:53', 0, '2014-06-18 04:06:10'),
(39, 7, 1, 102, 'ghkjh', 0, 11, 10, 1.2, 12, 0, 0, 0, 0, 16, '2014-07-03 04:06:00', 0, '0000-00-00 00:00:00'),
(40, 7, 2, 100, 'sdsw', 0, 3, 0, 0, 1, 0, 0, 0, 0, 16, '2014-07-03 04:06:23', 0, '0000-00-00 00:00:00'),
(41, 8, 1, 0, '', 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, '2014-07-03 04:11:56', 0, '0000-00-00 00:00:00'),
(43, 4, 1, 101, 'ASA', 0, 1, 6, 0.06, 1, 0, 0, 0, 0, 16, '2014-07-07 07:52:02', 0, '0000-00-00 00:00:00'),
(44, 4, 2, 101, 'DS', 0, 2, 0, 0, 1, 0, 0, 0, 0, 16, '2014-07-07 07:56:54', 0, '0000-00-00 00:00:00'),
(46, 4, 3, 102, 'WEW', 0, 1, 6, 0.06, 1, 0, 0, 0, 0, 16, '2014-07-07 07:58:41', 0, '0000-00-00 00:00:00'),
(47, 0, 1, 100, 'asdas', 0, 4, 0, 0, 1, 0, 0, 0, 0, 16, '2014-07-14 02:20:44', 0, '0000-00-00 00:00:00'),
(48, 11, 1, 100, 'asdas', 0, 4, 0, 0, 1, 0, 0, 0, 0, 16, '2014-07-14 02:23:51', 0, '0000-00-00 00:00:00'),
(49, 11, 2, 100, 'sdas', 0, 4, 0, 0, 1, 0, 0, 0, 0, 16, '2014-07-14 02:24:58', 0, '0000-00-00 00:00:00'),
(50, 12, 1, 100, 'asa', 0, 4, 0, 0, 1, 0, 0, 0, 0, 16, '2014-07-14 02:26:21', 0, '0000-00-00 00:00:00'),
(51, 12, 2, 100, 'dfsf', 0, 2, 0, 0, 2, 0, 0, 0, 0, 16, '2014-07-14 02:35:56', 0, '0000-00-00 00:00:00');

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

--
-- Table structure for table `comp_sales_creditnote_detail`
--

CREATE TABLE IF NOT EXISTS `comp_sales_creditnote_detail` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `creditnoteID` int(11) NOT NULL,
  `lineNo` int(11) NOT NULL,
  `itemID` int(11) NOT NULL,
  `itemname` varchar(64) NOT NULL,
  `itemdescription` text NOT NULL,
  `quantity` int(11) NOT NULL,
  `unitPrice` double NOT NULL,
  `amountExcludedTax` double NOT NULL,
  `taxID` int(11) NOT NULL,
  `taxRate` double NOT NULL,
  `taxAmount` double NOT NULL,
  `amountIncludedTax` double NOT NULL,
  `accountID` int(11) NOT NULL,
  `createdBy` int(11) NOT NULL,
  `createdTS` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `updatedBy` int(11) NOT NULL,
  `updatedTS` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=20 ;

--
-- Dumping data for table `comp_sales_creditnote_detail`
--

INSERT INTO `comp_sales_creditnote_detail` (`ID`, `creditnoteID`, `lineNo`, `itemID`, `itemname`, `itemdescription`, `quantity`, `unitPrice`, `amountExcludedTax`, `taxID`, `taxRate`, `taxAmount`, `amountIncludedTax`, `accountID`, `createdBy`, `createdTS`, `updatedBy`, `updatedTS`) VALUES
(1, 1, 1, 8, 'A25 Plastic Chair', 'Plastic Chair - White', 10, 200, 2000, 1, 6, 120, 2120, 0, 0, '2014-06-24 02:16:19', 0, '0000-00-00 00:00:00'),
(2, 2, 1, 9, '', 'Nasi Goreng Ayam', 1, 652, 652, 26, 11, 71.72, 723.72, 0, 16, '2014-07-02 07:40:30', 0, '0000-00-00 00:00:00'),
(3, 2, 2, 4, '', 'Plastic Chair - Blue', 3, 3, 9, 1, 0, 0, 9, 0, 16, '2014-07-02 07:41:19', 0, '0000-00-00 00:00:00'),
(4, 2, 3, 7, '', 'Plastic Chair - Red', 1, 0, 0, 0, 0, 0, 0, 0, 16, '2014-07-02 07:43:48', 0, '0000-00-00 00:00:00'),
(5, 3, 1, 8, '', 'Plastic Chair - White', 1, 1, 1, 28, 0, 0, 1, 0, 16, '2014-07-02 07:47:10', 0, '0000-00-00 00:00:00'),
(6, 4, 1, 4, '', 'Plastic Chair - Blue', 2, 1, 2, 0, 0, 0, 2, 0, 16, '2014-07-03 01:25:05', 0, '0000-00-00 00:00:00'),
(7, 4, 2, 10, '', 'Bola Tampar Buaya', 12, 1, 12, 1, 6, 0.72, 12.72, 0, 16, '2014-07-03 02:39:30', 16, '0000-00-00 00:00:00'),
(9, 5, 1, 1, '', 'Teak wooden chair with natural finish', 1, 321, 321, 12, 6, 19.26, 340.26, 0, 16, '2014-07-03 01:30:10', 0, '0000-00-00 00:00:00'),
(10, 5, 2, 8, '', 'Plastic Chair - White', 1, 0, 321, 10, 0, 19.26, 340.26, 0, 16, '2014-07-03 01:30:25', 0, '0000-00-00 00:00:00'),
(11, 7, 1, 1, '', 'Teak wooden chair with natural finish', 1, 321, 321, 12, 6, 19.26, 340.26, 0, 16, '2014-07-03 04:06:47', 0, '0000-00-00 00:00:00'),
(12, 9, 1, 7, '', 'Plastic Chair - Red', 1, 1, 1, 0, 0, 0, 1, 0, 16, '2014-07-03 04:14:43', 0, '0000-00-00 00:00:00'),
(13, 10, 1, 1, '', 'Teak wooden chair with natural finish', 1, 321, 321, 1, 6, 19.26, 340.26, 0, 16, '2014-07-14 02:09:30', 0, '0000-00-00 00:00:00'),
(14, 11, 1, 1, '', 'Teak wooden chair with natural finish', 1, 321, 321, 1, 6, 19.26, 340.26, 0, 16, '2014-07-14 02:15:35', 0, '0000-00-00 00:00:00'),
(15, 11, 2, 4, '', 'Plastic Chair - Blue', 1, 1, 1, 0, 0, 0, 1, 0, 16, '2014-07-14 02:19:24', 0, '0000-00-00 00:00:00'),
(16, 12, 1, 4, '', 'Plastic Chair - Blue', 1, 12, 12, 0, 1, 0.12, 12.12, 0, 16, '2014-07-14 02:36:28', 0, '0000-00-00 00:00:00'),
(17, 12, 2, 1, '', 'Teak wooden chair with natural finish', 1, 321, 321, 1, 6, 19.26, 340.26, 0, 16, '2014-07-14 02:52:54', 0, '0000-00-00 00:00:00'),
(18, 12, 3, 1, '', 'Teak wooden chair with natural finish', 1, 1, 1, 1, 6, 0.06, 1.06, 0, 16, '2014-07-14 03:08:55', 16, '0000-00-00 00:00:00'),
(19, 13, 1, 1, '', 'Teak wooden chair with natural finish', 23, 321, 7383, 1, 6, 442.98, 7825.98, 0, 33, '2014-08-14 03:10:09', 0, '0000-00-00 00:00:00');

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

--
-- Table structure for table `comp_sales_debitnote`
--

CREATE TABLE IF NOT EXISTS `comp_sales_debitnote` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `serialNo` int(11) NOT NULL DEFAULT '1',
  `companyID` int(11) NOT NULL,
  `customerID` int(11) NOT NULL,
  `formNo` varchar(32) NOT NULL,
  `debitNoteDate` date NOT NULL,
  `salesInvoiceID` int(11) NOT NULL,
  `projectID` int(11) NOT NULL,
  `termsID` int(11) NOT NULL,
  `currencyID` int(11) NOT NULL,
  `exchangeRate` double NOT NULL,
  `agentID` int(11) NOT NULL,
  `memo` text NOT NULL,
  `employeeID` int(11) NOT NULL,
  `shippingMethodID` int(11) NOT NULL,
  `totalAmount` double NOT NULL,
  `amountPaid` decimal(10,0) NOT NULL,
  `totalTaxAmount` double NOT NULL,
  `totalPayable` double NOT NULL,
  `total` 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` smallint(16) NOT NULL,
  `updateAble` tinyint(1) NOT NULL DEFAULT '1',
  `journalNo` varchar(32) NOT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=21 ;

--
-- Dumping data for table `comp_sales_debitnote`
--

INSERT INTO `comp_sales_debitnote` (`ID`, `serialNo`, `companyID`, `customerID`, `formNo`, `debitNoteDate`, `salesInvoiceID`, `projectID`, `termsID`, `currencyID`, `exchangeRate`, `agentID`, `memo`, `employeeID`, `shippingMethodID`, `totalAmount`, `amountPaid`, `totalTaxAmount`, `totalPayable`, `total`, `createdBy`, `createdTS`, `updatedBy`, `updatedTS`, `is_delete`, `updateAble`, `journalNo`) VALUES
(5, 1, 1, 12, 'SDN', '2014-06-12', 17, 1, 0, 0, 1, 0, 'ewe', 0, 0, 0, '0', 0, 0, 0, 16, '2014-06-12 09:52:06', 0, '2014-06-23 02:39:10', 0, 1, 'AR20140600000004'),
(6, 1, 1, 12, 'SDN', '2014-06-20', 18, 2, 0, 0, 1, 0, '', 0, 0, 0, '0', 0, 0, 0, 1, '2014-06-20 03:57:55', 0, '2014-06-20 04:32:04', 0, 1, 'AR20140600000002'),
(7, 1, 1, 12, 'SDN', '2014-06-23', 18, 2, 0, 0, 1, 0, '', 0, 0, 0, '0', 0, 0, 0, 16, '2014-06-23 09:52:58', 0, '2014-06-24 01:01:34', 0, 0, 'AR20140600000008'),
(8, 1, 1, 15, 'SDN', '2014-07-02', 20, 1, 0, 0, 3.1305, 0, 'sdsf', 0, 0, 0, '0', 0, 0, 0, 16, '2014-07-02 06:49:41', 0, '0000-00-00 00:00:00', 0, 1, ''),
(9, 1, 1, 12, 'SDN', '2014-07-02', 18, 15, 0, 0, 3.1305, 0, 'dfd', 0, 0, 0, '0', 0, 0, 0, 16, '2014-07-02 06:52:25', 0, '2014-07-17 08:06:33', 0, 0, ''),
(10, 1, 1, 12, 'SDN', '2014-07-03', 18, 1, 0, 0, 3.1305, 0, 'GDF GH', 0, 0, 797.55, '0', 38.67, 0, 0, 16, '2014-07-03 00:07:54', 0, '2014-07-14 06:31:45', 0, 1, ''),
(11, 1, 1, 12, 'SDN', '2014-07-03', 18, 15, 0, 0, 3.1305, 0, 'sds', 0, 0, 14.01, '0', 0.01, 0, 0, 16, '2014-07-03 05:00:15', 0, '2014-07-14 02:15:35', 0, 1, ''),
(12, 1, 1, 12, 'SDN', '2014-07-03', 18, 1, 0, 0, 3.1305, 0, '', 0, 0, 0, '0', 0, 0, 0, 1, '2014-07-03 08:16:47', 0, '0000-00-00 00:00:00', 0, 1, ''),
(13, 1, 1, 12, 'SDN', '2014-07-14', 18, 1, 0, 0, 3.1305, 0, 'sds sds', 0, 0, 0, '0', 0, 0, 0, 16, '2014-07-14 00:27:09', 0, '0000-00-00 00:00:00', 0, 1, ''),
(14, 1, 1, 12, 'SDN', '2014-07-14', 18, 1, 0, 0, 3.1305, 0, 'sds sds', 0, 0, 0, '0', 0, 0, 0, 16, '2014-07-14 00:27:29', 0, '0000-00-00 00:00:00', 0, 1, ''),
(15, 1, 1, 12, 'SDN', '2014-07-14', 18, 1, 0, 0, 3.1305, 0, 'sds sds', 0, 0, 0, '0', 0, 0, 0, 16, '2014-07-14 00:32:59', 0, '0000-00-00 00:00:00', 0, 1, ''),
(16, 1, 1, 12, 'SDN', '2014-07-14', 18, 1, 0, 0, 3.1305, 0, 'sds sds', 0, 0, 0, '0', 0, 0, 0, 16, '2014-07-14 00:44:23', 0, '0000-00-00 00:00:00', 0, 1, ''),
(17, 1, 1, 12, 'SDN', '2014-07-14', 18, 1, 0, 0, 3.1305, 0, 'sds sds', 0, 0, 0, '0', 0, 0, 0, 16, '2014-07-14 00:48:49', 0, '0000-00-00 00:00:00', 0, 1, ''),
(18, 1, 1, 12, 'SDN', '2014-07-14', 18, 1, 0, 0, 3.1305, 0, 'sds sds', 0, 0, 0, '0', 0, 0, 0, 16, '2014-07-14 00:49:12', 0, '0000-00-00 00:00:00', 0, 1, ''),
(19, 1, 1, 12, 'SDN', '2014-07-14', 18, 1, 0, 0, 3.1305, 0, 'sds sds', 0, 0, 12, '0', 0, 0, 0, 16, '2014-07-14 00:55:51', 0, '2014-07-14 01:39:11', 0, 1, ''),
(20, 1, 81, 33, 'SDN', '2014-07-21', 97, 22, 0, 0, 3.4, 0, '', 0, 0, 11660, '0', 660, 0, 0, 29, '2014-07-21 06:48:38', 0, '2014-07-21 06:48:39', 0, 1, '');

--
-- Triggers `comp_sales_debitnote`
--
DROP TRIGGER IF EXISTS `trigger_before_insert_sdn_add_serialNo`;
DELIMITER //
CREATE TRIGGER `trigger_before_insert_sdn_add_serialNo` BEFORE INSERT ON `comp_sales_debitnote`
 FOR EACH ROW set new.serialNo = (select nextSerialNo 
			   from view_serial_comp_sales_debitnote
			   where companyID = new.companyID)
//
DELIMITER ;

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

--
-- Table structure for table `comp_sales_debitnote_charges`
--

CREATE TABLE IF NOT EXISTS `comp_sales_debitnote_charges` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `debitNoteID` int(11) NOT NULL,
  `lineNo` int(11) NOT NULL,
  `accountNoID` int(11) NOT NULL,
  `chargeDescription` text NOT NULL,
  `amountExcludedTax` double NOT NULL,
  `taxID` int(11) NOT NULL,
  `taxRate` double NOT NULL,
  `taxAmount` double NOT NULL,
  `amountIncludedTax` double NOT NULL,
  `drAccountID` int(11) NOT NULL,
  `crAccountID` int(11) NOT NULL,
  `drTaxAccountID` int(11) NOT NULL,
  `crTaxAccountID` 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 '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=49 ;

--
-- Dumping data for table `comp_sales_debitnote_charges`
--

INSERT INTO `comp_sales_debitnote_charges` (`ID`, `debitNoteID`, `lineNo`, `accountNoID`, `chargeDescription`, `amountExcludedTax`, `taxID`, `taxRate`, `taxAmount`, `amountIncludedTax`, `drAccountID`, `crAccountID`, `drTaxAccountID`, `crTaxAccountID`, `createdBy`, `createdTS`, `updatedBy`, `updatedTS`) VALUES
(38, 11, 1, 102, 'dsa', 0, 5, 0, 0, 12, 0, 0, 0, 0, 16, '2014-07-03 05:00:15', 0, '0000-00-00 00:00:00'),
(39, 0, 2, 102, 'dewe', 0, 11, 10, 0.1, 1, 0, 0, 0, 0, 16, '2014-07-03 05:00:35', 0, '0000-00-00 00:00:00'),
(40, 0, 3, 100, 'we', 0, 5, 0, 1, 1, 0, 0, 0, 0, 16, '2014-07-03 05:02:36', 0, '0000-00-00 00:00:00'),
(41, 0, 4, 100, 'as', 0, 5, 0, 0, 1, 0, 0, 0, 0, 16, '2014-07-03 05:04:17', 0, '0000-00-00 00:00:00'),
(42, 0, 1, 101, 'dfd', 0, 1, 6, 0.06, 1, 0, 0, 0, 0, 16, '2014-07-07 08:24:59', 0, '0000-00-00 00:00:00'),
(43, 0, 1, 101, 'sd', 0, 1, 6, 0.06, 1, 0, 0, 0, 0, 16, '2014-07-07 08:27:25', 0, '0000-00-00 00:00:00'),
(44, 10, 1, 101, 'WE', 0, 2, 0, 0, 1, 0, 0, 0, 0, 16, '2014-07-07 08:29:31', 0, '0000-00-00 00:00:00'),
(45, 10, 2, 101, '12', 0, 1, 6, 0.06, 1, 0, 0, 0, 0, 16, '2014-07-07 08:29:56', 0, '0000-00-00 00:00:00'),
(46, 10, 3, 101, 'sds', 0, 1, 6, 0.06, 1, 0, 0, 0, 0, 16, '2014-07-07 08:46:25', 0, '0000-00-00 00:00:00'),
(47, 10, 4, 98, 'sds', 111111, 2, 0, 0, 111, 0, 0, 0, 0, 16, '2014-07-07 08:46:44', 16, '2014-07-14 06:31:45'),
(48, 19, 1, 100, 'xcsxd', 0, 4, 0, 0, 12, 0, 0, 0, 0, 16, '2014-07-14 00:57:19', 0, '0000-00-00 00:00:00');

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

--
-- Table structure for table `comp_sales_debitnote_detail`
--

CREATE TABLE IF NOT EXISTS `comp_sales_debitnote_detail` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `debitnoteID` int(11) NOT NULL,
  `lineNo` int(11) NOT NULL,
  `itemID` int(11) NOT NULL,
  `itemname` varchar(64) NOT NULL,
  `itemdescription` text NOT NULL,
  `quantity` int(11) NOT NULL,
  `unitPrice` double NOT NULL,
  `amountExcludedTax` double NOT NULL,
  `taxID` int(11) NOT NULL,
  `taxRate` double NOT NULL,
  `taxAmount` double NOT NULL,
  `amountIncludedTax` double NOT NULL,
  `accountID` int(11) NOT NULL,
  `createdBy` int(11) NOT NULL,
  `createdTS` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `updatedBy` int(11) NOT NULL,
  `updatedTS` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=31 ;

--
-- Dumping data for table `comp_sales_debitnote_detail`
--

INSERT INTO `comp_sales_debitnote_detail` (`ID`, `debitnoteID`, `lineNo`, `itemID`, `itemname`, `itemdescription`, `quantity`, `unitPrice`, `amountExcludedTax`, `taxID`, `taxRate`, `taxAmount`, `amountIncludedTax`, `accountID`, `createdBy`, `createdTS`, `updatedBy`, `updatedTS`) VALUES
(6, 5, 1, 2, 'Steel chair for outdoor', 'B13 Steel Chair', 1, 1, 1, 1, 6, 0.06, 1.06, 0, 16, '2014-06-18 04:06:39', 0, '0000-00-00 00:00:00'),
(7, 6, 1, 1, 'Teak wooden chair with natural finish', 'A12 Wooden Chair', 1, 120, 120, 10, 6, 7.2, 127.2, 0, 1, '2014-06-20 03:59:35', 0, '0000-00-00 00:00:00'),
(9, 7, 1, 2, 'Steel chair for outdoor', 'B13 Steel Chair', 1, 1, 1, 1, 6, 0.06, 1.06, 0, 16, '2014-06-24 00:50:01', 0, '0000-00-00 00:00:00'),
(10, 8, 0, 1, '', 'Teak wooden chair with natural finish', 1, 321, 321, 0, 6, 19.26, 340.26, 0, 16, '2014-07-02 06:49:41', 0, '0000-00-00 00:00:00'),
(11, 8, 0, 10, '', 'Bola Tampar Buaya', 1, 1, 1, 0, 6, 0.06, 1.06, 0, 16, '2014-07-02 06:51:41', 0, '0000-00-00 00:00:00'),
(12, 9, 0, 4, '', 'Plastic Chair - Blue', 12, 1, 12, 1, 0, 0, 12, 0, 16, '2014-07-02 06:52:25', 0, '0000-00-00 00:00:00'),
(13, 9, 0, 7, '', 'Plastic Chair - Red', 21, 12, 252, 0, 0, 0, 252, 0, 16, '2014-07-02 06:52:36', 0, '0000-00-00 00:00:00'),
(15, 10, 1, 4, '', 'Plastic Chair - Blue', 1, 1, 1, 6, 1, 0.01, 1.01, 0, 16, '2014-07-03 00:07:54', 0, '0000-00-00 00:00:00'),
(16, 10, 2, 8, '', 'Plastic Chair - White', 2, 1, 2, 5, 1, 0.02, 2.02, 0, 16, '2014-07-03 01:22:03', 16, '0000-00-00 00:00:00'),
(17, 11, 1, 7, '', 'Plastic Chair - Red', 1, 1, 1, 0, 0, 0, 1, 0, 16, '2014-07-03 05:00:48', 0, '0000-00-00 00:00:00'),
(18, 11, 2, 7, '', 'Plastic Chair - Red', 1, 1, 1, 0, 1, 0.01, 1.01, 0, 16, '2014-07-03 05:01:17', 0, '0000-00-00 00:00:00'),
(19, 12, 1, 1, '', 'Teak wooden chair with natural finish', 10, 321, 3210, 12, 6, 192.6, 3402.6, 0, 1, '2014-07-03 08:16:47', 0, '0000-00-00 00:00:00'),
(20, 10, 3, 1, '', 'Teak wooden chair with natural finish', 1, 321, 321, 1, 6, 19.26, 340.26, 0, 16, '2014-07-07 08:53:03', 0, '0000-00-00 00:00:00'),
(22, 10, 4, 1, '', 'Teak wooden chair with natural finish', 1, 321, 321, 1, 6, 19.26, 340.26, 0, 16, '2014-07-07 08:54:59', 0, '0000-00-00 00:00:00'),
(23, 13, 1, 1, '', 'Teak wooden chair with natural finish', 1, 321, 321, 1, 6, 19.26, 340.26, 0, 16, '2014-07-14 00:27:09', 0, '0000-00-00 00:00:00'),
(24, 14, 1, 1, '', 'Teak wooden chair with natural finish', 1, 321, 321, 1, 6, 19.26, 340.26, 0, 16, '2014-07-14 00:27:29', 0, '0000-00-00 00:00:00'),
(25, 15, 1, 1, '', 'Teak wooden chair with natural finish', 1, 321, 321, 1, 6, 19.26, 340.26, 0, 16, '2014-07-14 00:32:59', 0, '0000-00-00 00:00:00'),
(26, 16, 1, 1, '', 'Teak wooden chair with natural finish', 1, 321, 321, 1, 6, 19.26, 340.26, 0, 16, '2014-07-14 00:44:23', 0, '0000-00-00 00:00:00'),
(27, 17, 1, 1, '', 'Teak wooden chair with natural finish', 1, 321, 321, 1, 6, 19.26, 340.26, 0, 16, '2014-07-14 00:48:49', 0, '0000-00-00 00:00:00'),
(28, 18, 1, 1, '', 'Teak wooden chair with natural finish', 1, 321, 321, 1, 6, 19.26, 340.26, 0, 16, '2014-07-14 00:49:12', 0, '0000-00-00 00:00:00'),
(30, 20, 1, 16, '', 'Wireless', 10, 1100, 11000, 0, 6, 660, 11660, 0, 29, '2014-07-21 06:48:39', 0, '0000-00-00 00:00:00');

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

--
-- Table structure for table `comp_sales_detail`
--

CREATE TABLE IF NOT EXISTS `comp_sales_detail` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `salesID` int(11) NOT NULL,
  `invoiceID` int(11) NOT NULL DEFAULT '0',
  `lineNo` int(11) NOT NULL,
  `itemID` int(11) NOT NULL,
  `description` varchar(200) DEFAULT NULL,
  `unitPrice` double DEFAULT NULL,
  `unitmeasure` int(11) DEFAULT NULL,
  `quantityOrder` double DEFAULT NULL,
  `quantityShip` double DEFAULT '0',
  `amount` double DEFAULT NULL,
  `requiredDate` date DEFAULT NULL,
  `createdBy` int(11) DEFAULT NULL,
  `createdTS` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updatedBy` int(11) DEFAULT NULL,
  `updatedTS` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=16 ;

--
-- Dumping data for table `comp_sales_detail`
--

INSERT INTO `comp_sales_detail` (`ID`, `salesID`, `invoiceID`, `lineNo`, `itemID`, `description`, `unitPrice`, `unitmeasure`, `quantityOrder`, `quantityShip`, `amount`, `requiredDate`, `createdBy`, `createdTS`, `updatedBy`, `updatedTS`) VALUES
(1, 1, 89, 0, 1, 'Teak wooden chair with natural finish', 120, 2, 120, 83, 14400, '2014-06-11', 1, '2014-06-11 07:24:02', 1, '2014-06-11 07:24:02'),
(2, 1, 0, 0, 7, 'Plastic Chair - Red', 15, 2, 1000, 500, 15000, '2014-06-11', 1, '2014-06-11 07:24:16', 1, '2014-06-11 07:24:16'),
(3, 1, 89, 0, 2, 'Steel chair for outdoor', 90, 2, 250, 0, 22500, '2014-06-11', 1, '2014-06-11 07:24:37', NULL, '2014-06-11 07:24:37'),
(4, 2, 0, 0, 1, 'Teak wooden chair with natural finish', 30, 2, 1200, 12, 36000, '2014-06-11', 1, '2014-06-11 07:25:26', 1, '2014-06-11 07:25:26'),
(5, 2, 0, 0, 8, 'Plastic Chair - White', 122, 2, 120, 10, 14640, '2014-06-11', 1, '2014-06-11 07:25:39', 1, '2014-06-11 07:25:39'),
(6, 2, 0, 0, 10, 'Bola Tampar Buaya', 30, 2, 20, 0, 600, '2014-06-11', 1, '2014-06-11 07:25:52', NULL, '2014-06-11 07:25:52'),
(7, 3, 90, 0, 1, 'Teak wooden chair with natural finish', 120, 2, 10, 0, 1200, '2014-06-18', 1, '2014-06-18 01:45:07', NULL, '2014-06-18 01:45:07'),
(8, 3, 0, 0, 2, 'Steel chair for outdoor', 230, 2, 2300, 0, 529000, '2014-06-18', 1, '2014-06-18 01:45:21', NULL, '2014-06-18 01:45:21'),
(9, 2, 0, 0, 7, 'Plastic Chair - Red', 10, 2, 1234, 0, 12340, '2014-06-18', 1, '2014-06-18 01:45:35', NULL, '2014-06-18 01:45:35'),
(10, 4, 0, 0, 8, 'Plastic Chair - White', 1000, 2, 1000, 0, 1000000, '2014-06-18', 1, '2014-06-18 03:49:20', NULL, '2014-06-18 03:49:20'),
(11, 5, 0, 0, 10, 'Bola Tampar Buaya', 35, 2, 1000, 0, 35000, '2014-06-18', 1, '2014-06-18 03:49:52', NULL, '2014-06-18 03:49:52'),
(12, 6, 0, 0, 11, 'saiz 10. warna gold', 250, 2, 1, 0, 250, '2014-07-17', 16, '2014-07-17 03:09:34', NULL, '2014-07-17 03:09:34'),
(13, 7, 0, 0, 4, 'Plastic Chair - Blue', 23, 2, 3, 0, 69, '2014-07-18', 16, '2014-07-18 06:57:43', NULL, '2014-07-18 06:57:43'),
(14, 8, 0, 0, 7, 'Plastic Chair - Red', 34, 2, 4, 0, 136, '2014-07-18', 16, '2014-07-18 07:02:35', NULL, '2014-07-18 07:02:35'),
(15, 8, 0, 0, 2, 'Steel chair for outdoor', 56, 2, 8, 0, 448, '2014-07-18', 16, '2014-07-18 07:02:55', NULL, '2014-07-18 07:02:55');

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

--
-- Table structure for table `comp_sales_invoice`
--

CREATE TABLE IF NOT EXISTS `comp_sales_invoice` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `serialNo` int(11) NOT NULL DEFAULT '1',
  `companyID` int(11) NOT NULL,
  `invoiceCodeID` int(11) NOT NULL COMMENT '1=sales inv, 2=direct sales inv,  3=debitNote, 4=creditNte',
  `salesID` int(11) NOT NULL,
  `customerID` int(11) NOT NULL,
  `formNo` varchar(32) NOT NULL,
  `salesInvoiceDate` date NOT NULL,
  `customerPoNo` varchar(32) NOT NULL,
  `locationID` int(11) NOT NULL,
  `projectID` int(11) NOT NULL,
  `termsID` int(11) NOT NULL,
  `shipToID` int(11) NOT NULL,
  `currencyID` int(11) NOT NULL,
  `exchangeRate` double NOT NULL,
  `agentID` int(11) NOT NULL,
  `printInInvoice` smallint(6) NOT NULL DEFAULT '0',
  `memo` text NOT NULL,
  `employeeID` int(11) NOT NULL,
  `showSaleAgent` tinyint(4) NOT NULL,
  `shippingMethodID` int(11) NOT NULL,
  `totalTaxAmount` double NOT NULL,
  `totalReceivable` double NOT NULL,
  `totalamount` 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` smallint(6) NOT NULL DEFAULT '0',
  `updateAble` smallint(6) NOT NULL DEFAULT '1',
  `journalNo` varchar(32) NOT NULL,
  `salesOrderID` int(11) DEFAULT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=156 ;

--
-- Dumping data for table `comp_sales_invoice`
--

INSERT INTO `comp_sales_invoice` (`ID`, `serialNo`, `companyID`, `invoiceCodeID`, `salesID`, `customerID`, `formNo`, `salesInvoiceDate`, `customerPoNo`, `locationID`, `projectID`, `termsID`, `shipToID`, `currencyID`, `exchangeRate`, `agentID`, `printInInvoice`, `memo`, `employeeID`, `showSaleAgent`, `shippingMethodID`, `totalTaxAmount`, `totalReceivable`, `totalamount`, `createdBy`, `createdTS`, `updatedBy`, `updatedTS`, `is_delete`, `updateAble`, `journalNo`, `salesOrderID`) VALUES
(18, 1, 1, 0, 0, 12, 'SON20140618', '2014-06-18', 'aaw', 1, 1, 5, 1, 1, 1, 1, 0, 'sdadc', 7, 0, 3, 0, -2509.44, 2509.44, 16, '2014-06-18 02:11:17', 0, '2014-06-27 02:30:38', 0, 1, 'AR20140600000005', NULL),
(19, 1, 1, 0, 0, 12, 'SON20140626', '2014-06-26', 'ghj', 1, 1, 5, 1, 1, 0, 1, 0, '1ygul', 7, 0, 4, 39.24, 6293.5, 6293.5, 16, '2014-06-26 06:49:57', 0, '2014-07-08 02:22:46', 0, 1, '', NULL),
(20, 1, 1, 0, 0, 15, 'SON20140627', '2014-06-17', '12', 1, 1, 6, 1, 0, 3.1305, 1, 0, 'sds', 7, 0, 4, 0, -12, 36.72, 16, '2014-06-27 07:11:02', 0, '2014-06-27 07:18:03', 0, 1, '', NULL),
(21, 1, 1, 0, 0, 12, 'SON20140627', '2014-06-25', 'w3', 1, 2, 5, 1, 0, 3.1305, 1, 0, 'de', 7, 0, 4, 0, -1.01, 1.01, 16, '2014-06-27 07:22:31', 0, '2014-06-27 07:24:55', 0, 1, '', NULL),
(22, 1, 1, 0, 0, 12, 'SON20140627', '2014-06-24', 'sd', 1, 2, 5, 1, 0, 3.1305, 1, 0, 'wew', 7, 0, 3, 0, -3.16, 3.16, 16, '2014-06-27 07:27:12', 0, '2014-06-27 07:28:48', 0, 1, '', NULL),
(23, 1, 1, 0, 0, 12, 'SON20140627', '2014-06-10', 'sds', 1, 2, 7, 1, 0, 3.1305, 1, 0, 'sds', 6, 0, 5, 0, -1, 12, 16, '2014-06-27 07:34:10', 0, '2014-06-27 07:38:01', 0, 1, '', NULL),
(24, 1, 1, 0, 0, 12, 'SON20140627', '2014-06-04', 'w', 1, 1, 7, 2, 0, 3.1305, 1, 0, 'sds', 6, 0, 5, 0, -1, 1, 16, '2014-06-27 07:34:59', 0, '2014-06-27 07:38:01', 0, 1, '', NULL),
(25, 1, 1, 0, 0, 12, 'SON20140627', '2014-06-06', 'q1', 2, 1, 5, 1, 0, 3.1305, 1, 0, 'ada', 7, 0, 5, 0, 1, 1, 16, '2014-06-27 07:46:47', 0, '2014-07-01 03:04:08', 0, 1, '', NULL),
(26, 1, 1, 0, 0, 15, 'SON20140627', '2014-06-06', 'we', 2, 1, 5, 2, 0, 3.1305, 1, 0, 'wew', 7, 0, 8, 0, -1, 1, 16, '2014-06-27 07:47:23', 0, '2014-06-27 07:49:42', 0, 1, '', NULL),
(27, 1, 1, 0, 0, 15, 'SON20140627', '2014-06-03', 'as', 2, 1, 5, 2, 0, 3.1305, 1, 0, 'as', 6, 0, 8, 0, -1, 1, 16, '2014-06-27 07:48:33', 0, '2014-06-27 07:49:42', 0, 1, '', NULL),
(28, 1, 1, 0, 0, 12, 'SON20140627', '2014-06-25', '12', 2, 1, 8, 1, 0, 3.1305, 1, 0, 'sd', 6, 0, 5, 0, 1060.31, 1394.36, 16, '2014-06-30 00:35:53', 0, '2014-07-01 03:10:54', 0, 1, '', NULL),
(29, 1, 1, 0, 0, 12, 'SON20140711', '2014-07-07', 'we', 2, 15, 7, 4, 0, 3.1305, 1, 0, 'sdw', 7, 0, 6, 27.36, 7535.36, 7535.36, 16, '2014-06-30 00:42:25', 0, '2014-07-11 02:34:42', 0, 1, '', NULL),
(30, 1, 1, 0, 0, 12, 'SON20140630', '2014-06-24', 'sew', 2, 17, 7, 1, 0, 3.1305, 1, 0, 'sdw', 6, 0, 5, 0, 0, 12, 16, '2014-06-30 00:44:08', 0, '2014-07-01 08:15:41', 0, 1, '', NULL),
(31, 1, 1, 0, 0, 12, 'SON20140709', '2014-07-07', 'sew', 2, 17, 7, 1, 0, 3.1305, 1, 0, 'ewe', 7, 0, 73, 1.44, 25.72, 25.72, 16, '2014-06-30 01:01:13', 0, '2014-07-14 07:55:14', 0, 1, '', NULL),
(32, 1, 1, 0, 0, 16, 'SON20140630', '2014-07-07', 'as', 2, 1, 5, 1, 0, 3.1305, 1, 0, 'wewd', 7, 0, 8, 0, -1, 654.06, 16, '2014-06-30 03:42:50', 0, '2014-07-09 02:15:59', 0, 1, '', NULL),
(33, 1, 1, 0, 0, 12, 'SON20140702', '2014-07-02', 'asdfasdf245345345', 1, 1, 5, 1, 0, 3.1305, 1, 0, '', 6, 0, 73, 0, 1020.78, 1020.78, 16, '2014-07-02 06:40:16', 0, '2014-07-04 01:26:02', 0, 0, 'AR20140700000001', NULL),
(34, 1, 1, 0, 0, 12, 'SON20140702', '2014-07-02', 'wafasdfasdf', 1, 1, 5, 1, 0, 3.1305, 1, 0, '', 7, 0, 74, 0, 3103.68, 3103.68, 16, '2014-07-02 07:54:56', 0, '2014-07-02 07:55:50', 0, 1, '', NULL),
(35, 1, 1, 2, 0, 12, 'SON20140704', '2014-06-11', 'safsfg234', 1, 2, 5, 8, 0, 1, 1, 0, 'test memo', 6, 0, 73, 2, 24830.5, 24830.5, 16, '2014-07-04 03:43:21', 0, '0000-00-00 00:00:00', 0, 1, '', NULL),
(36, 1, 1, 2, 0, 12, 'SON20140704', '2014-06-11', 'dsfas2452345', 1, 2, 8, 1, 0, 1, 1, 0, 'test memo', 6, 0, 74, 207.18, 42671.04, 42671.04, 16, '2014-07-04 03:45:10', 0, '2014-07-04 03:47:24', 0, 1, '', NULL),
(37, 1, 1, 1, 0, 12, 'SON20140704', '2014-06-11', 'ADASR353254', 1, 1, 6, 8, 0, 1, 1, 0, 'test memo', 6, 0, 73, 2, 26017.7, 26017.7, 16, '2014-07-04 03:53:15', 0, '0000-00-00 00:00:00', 0, 1, '', NULL),
(38, 1, 1, 2, 0, 12, 'SON20140707', '2014-07-07', 'd', 1, 1, 5, 2, 0, 3.1305, 1, 0, 'vcv s', 7, 0, 5, 2.7, 60.7, 60.7, 16, '2014-07-07 06:04:17', 0, '2014-07-08 08:07:10', 0, 1, '', NULL),
(39, 1, 1, 2, 0, 12, 'SON20140707', '2014-07-07', 'er', 2, 1, 7, 1, 0, 3.1305, 1, 0, 'er', 7, 0, 8, 0, 686.58, 686.58, 16, '2014-07-07 06:13:13', 0, '2014-07-07 06:59:04', 0, 1, '', NULL),
(40, 1, 1, 1, 0, 12, 'SON20140707', '2014-06-18', 'asdfas45345', 2, 2, 6, 7, 0, 1, 1, 0, '', 7, 0, 73, 31, 0, 0, 16, '2014-07-07 06:42:29', 0, '0000-00-00 00:00:00', 0, 1, '', NULL),
(41, 1, 1, 1, 0, 15, 'SON20140707', '2014-06-18', 'asdfasdf23452345', 1, 1, 5, 7, 0, 1, 1, 0, 'sfdgsdfgsdg', 7, 0, 74, 272.7, 58223.4, 58223.4, 16, '2014-07-07 06:45:19', 0, '2014-07-07 06:45:33', 0, 1, '', NULL),
(75, 1, 1, 2, 0, 15, 'SON20140709', '2014-07-01', 'Clone invoice', 2, 17, 5, 1, 0, 0, 1, 0, 'vcv s', 6, 0, 5, 27.36, 483.36, 483.36, 16, '2014-07-07 06:04:17', 0, '2014-07-09 03:14:22', 0, 1, '', NULL),
(76, 1, 1, 2, 0, 12, 'SON20140707', '2014-07-07', 'd', 1, 1, 5, 2, 0, 3.1305, 1, 0, 'vcv s', 7, 0, 5, 2.7, -122, 60.7, 16, '2014-07-07 06:04:17', 0, '2014-07-10 04:02:58', 0, 1, '', NULL),
(77, 1, 1, 0, 0, 12, 'SON20140711', '2014-07-07', 'we', 2, 15, 7, 4, 0, 3.1305, 1, 0, 'sdw', 7, 0, 6, 27.36, 7535.36, 7535.36, 16, '2014-06-30 00:42:25', 0, '2014-07-11 02:34:42', 0, 1, '', NULL),
(80, 1, 1, 1, 0, 12, 'SON20140711', '2014-07-11', 'asfa45', 1, 10, 7, 2, 0, 3.23, 1, 0, 'fdasdfafd', 7, 0, 73, 864, 493.96, 493.96, 16, '2014-07-11 08:51:41', 0, '0000-00-00 00:00:00', 0, 1, '', NULL),
(81, 1, 1, 1, 0, 12, 'SON20140711', '2014-07-11', 'asdf2345', 1, 2, 6, 1, 0, 2.34, 1, 0, '', 6, 0, 73, 33145.02, 491.84, 1889.6799999999998, 16, '2014-07-11 08:59:06', 0, '2014-07-11 08:59:34', 0, 1, '', NULL),
(82, 1, 1, 1, 0, 12, 'SON20140711', '2014-07-11', 'asdf2345', 1, 1, 5, 1, 0, 3.44, 1, 0, '', 6, 0, 74, 33, 0, 0, 16, '2014-07-11 09:00:31', 0, '0000-00-00 00:00:00', 0, 1, '', NULL),
(83, 1, 1, 1, 0, 12, 'SON20140711', '2014-07-11', 'asdf2345', 1, 1, 5, 1, 0, 0, 1, 0, '', 6, 0, 74, 72, 0, 0, 16, '2014-07-11 09:01:29', 0, '0000-00-00 00:00:00', 0, 1, '', NULL),
(84, 1, 1, 1, 0, 12, 'SON20140711', '2014-07-11', 'adfa2345', 1, 10, 5, 1, 0, 0, 1, 0, '', 7, 0, 5, 72, 0, 0, 16, '2014-07-11 09:02:05', 0, '0000-00-00 00:00:00', 0, 1, '', NULL),
(85, 1, 1, 1, 0, 12, 'SON20140711', '2014-07-11', 'asfasgf324543', 1, 10, 5, 1, 0, 4.33, 1, 0, '', 6, 0, 73, 1, 0, 0, 16, '2014-07-11 09:03:17', 0, '0000-00-00 00:00:00', 0, 1, '', NULL),
(86, 1, 1, 1, 0, 12, 'SON20140711', '2014-07-11', 'sadfas2345', 1, 2, 6, 1, 0, 0, 1, 0, '', 6, 0, 73, 31, 0, 0, 16, '2014-07-11 09:08:40', 0, '0000-00-00 00:00:00', 0, 1, '', NULL),
(87, 1, 1, 1, 0, 12, 'SON20140711', '2014-07-11', 'adfas2345', 1, 2, 6, 1, 0, 3.33, 1, 0, '', 6, 0, 74, 31, 0, 0, 16, '2014-07-11 09:29:31', 0, '2014-07-17 06:56:38', 0, 0, '', NULL),
(88, 1, 1, 1, 0, 12, 'SON20140711', '2014-07-11', 'asdf324523', 1, 1, 6, 1, 0, 3.44, 1, 0, '', 6, 0, 73, 2, 0, 0, 16, '2014-07-11 09:30:18', 0, '0000-00-00 00:00:00', 0, 1, '', NULL),
(89, 1, 1, 1, 0, 12, 'SON20140714', '2014-07-14', 'asdf234523', 1, 10, 6, 1, 0, 3.1305, 1, 0, 'sd adadf afd', 6, 0, 74, 2, 480.18, 480.18, 16, '2014-07-14 00:47:46', 0, '0000-00-00 00:00:00', 0, 1, '', NULL),
(90, 1, 1, 1, 0, 12, 'SON20140714', '2014-07-14', 'fsfsaf453', 2, 15, 6, 1, 0, 3.24, 1, 0, 'sdfggfs', 6, 0, 73, 72, 0, 0, 16, '2014-07-14 00:50:58', 0, '0000-00-00 00:00:00', 0, 1, '', NULL),
(91, 1, 1, 2, 0, 12, 'SON20140714', '2014-07-14', 'asa', 1, 10, 5, 1, 0, 3.1305, 1, 0, 'eqwwe', 7, 0, 5, 0.06, 2.06, 0, 16, '2014-07-14 06:42:06', 0, '2014-07-14 06:48:09', 0, 1, '', NULL),
(92, 1, 1, 2, 0, 15, 'SON20140714', '2014-07-14', 'asa', 1, 17, 5, 1, 0, 3.1305, 1, 0, 'asa sdas', 6, 0, 8, 6.666666666666668e18, 341.26, 1.1777777777777779e20, 16, '2014-07-14 06:55:31', 0, '2014-07-14 06:58:13', 0, 1, '', NULL),
(93, 1, 1, 2, 0, 12, 'SON20140714', '2014-07-14', 'sa', 1, 2, 7, 1, 0, 3.1305, 1, 0, 'sas', 6, 0, 5, 7.319999999999999, 1.06, 129.32, 16, '2014-07-14 07:08:01', 0, '2014-07-14 07:08:35', 0, 1, '', NULL),
(94, 1, 1, 2, 0, 12, 'SON20140714', '2014-07-14', 'asa', 1, 10, 5, 1, 0, 3.1305, 1, 0, 'eqwwe', 7, 0, 5, 0.06, 2.06, 0, 16, '2014-07-14 06:42:06', 0, '2014-07-14 06:48:09', 0, 1, '', NULL),
(95, 1, 1, 1, 0, 12, 'SON20140716', '2014-06-12', 'asdfrtrt', 1, 1, 5, 1, 0, 2.34, 1, 0, '', 6, 0, 73, 434.7, 7679.7, 7679.7, 16, '2014-07-16 04:29:50', 0, '2014-07-16 04:30:49', 0, 1, '', NULL),
(96, 1, 1, 2, 0, 15, 'SON20140714', '2014-07-14', 'asa', 1, 17, 5, 1, 1, 3.1305, 1, 0, 'asa sdas', 6, 0, 8, 6.666666666666668e18, 341.26, 1.1777777777777779e20, 16, '2014-07-14 06:55:31', 0, '2014-08-11 07:18:20', 0, 1, '', NULL),
(97, 1, 81, 1, 0, 33, 'SON', '2014-07-21', '001', 9, 22, 17, 1, 1, 0, 11, 0, '', 21, 0, 6, 0, 0, 0, 29, '2014-07-21 04:01:52', 0, '2014-08-11 07:18:16', 0, 1, '', NULL),
(98, 2, 1, 2, 0, 12, 'SON20140801', '2014-08-01', 'das', 1, 1, 17, 1, 1, 3.1305, 1, 0, 'sada', 6, 0, 6, 19.26, 340.26, 340.26, 1, '2014-08-01 03:46:15', 0, '2014-08-11 07:18:12', 0, 0, 'AR20140800000005', NULL),
(99, 3, 1, 2, 0, 12, 'SON20140801', '2014-08-01', 'das', 1, 1, 17, 1, 1, 3.1305, 1, 0, 'sada', 6, 0, 6, 19.26, 340.26, 340.26, 1, '2014-08-01 03:46:15', 0, '2014-08-11 07:18:09', 0, 0, 'AR20140800000002', NULL),
(100, 4, 1, 2, 0, 12, 'SON20140801', '2014-08-01', 'das', 1, 1, 17, 1, 1, 3.1305, 1, 0, 'sada', 6, 0, 6, 77.04, 1361.04, 1361.04, 1, '2014-08-01 03:46:15', 0, '2014-08-11 07:18:06', 0, 0, 'AR20140800000001', NULL),
(101, 5, 1, 1, 0, 12, 'SON20140805', '2014-08-05', 'lkjnlk', 1, 1, 17, 3, 1, 0, 1, 0, 'sdsd', 26, 0, 5, 72, 8772, 8772, 1, '2014-08-05 02:00:09', 0, '2014-08-11 07:18:00', 0, 1, '', NULL),
(102, 6, 1, 1, 0, 12, 'SON20140805', '2014-08-05', 'lkjnlk', 1, 1, 17, 3, 1, 0, 1, 0, 'sdsd', 26, 0, 5, 72, 118.72, 118.72, 1, '2014-08-05 02:00:22', 0, '2014-08-11 07:17:55', 0, 1, '', NULL),
(103, 7, 1, 1, 0, 12, 'SON20140805', '2014-08-05', 'lkjnlk', 1, 1, 17, 3, 1, 0, 1, 0, 'sdsd', 26, 0, 5, 72, 118.72, 118.72, 1, '2014-08-05 02:00:25', 0, '2014-08-11 07:17:51', 0, 1, '', NULL),
(104, 8, 1, 1, 0, 12, 'SON20140805', '2014-08-05', 'lkjnlk', 1, 1, 17, 3, 1, 0, 1, 0, 'sdsd', 26, 0, 5, 72, 118.72, 118.72, 1, '2014-08-05 02:00:35', 0, '2014-08-11 07:17:45', 0, 1, '', NULL),
(105, 9, 1, 1, 0, 12, 'SON20140805', '2014-08-05', 'lkjnlk', 1, 1, 17, 3, 1, 0, 1, 0, 'sdsd', 26, 0, 5, 72, 118.72, 118.72, 1, '2014-08-05 02:00:38', 0, '2014-08-11 07:17:40', 0, 1, '', NULL),
(106, 10, 1, 1, 0, 12, 'SON20140805', '2014-08-05', 'lkjnlk', 1, 1, 17, 3, 1, 0, 1, 0, 'sdsd', 26, 0, 5, 72, 8772, 8772, 1, '2014-08-05 02:00:41', 0, '2014-08-11 07:17:35', 0, 1, '', NULL),
(107, 11, 1, 1, 0, 12, 'SON20140805', '2014-08-05', 'lkjnlk', 1, 1, 17, 3, 1, 0, 1, 0, 'sdsd', 26, 0, 5, 72, 8772, 8772, 1, '2014-08-05 02:00:46', 0, '2014-08-11 07:17:23', 0, 1, '', NULL),
(108, 12, 1, 1, 0, 12, 'SON20140805', '2014-08-05', 'lkjnlk', 1, 1, 17, 3, 1, 0, 1, 0, 'sdsd', 26, 0, 5, 72, 8772, 8772, 1, '2014-08-05 02:00:49', 0, '2014-08-11 07:17:17', 0, 1, '', NULL),
(109, 13, 1, 1, 0, 12, 'SON20140805', '2014-08-05', 'lkjnlk', 1, 1, 17, 3, 1, 0, 1, 0, 'sdsd', 26, 0, 5, 72, 8772, 8772, 1, '2014-08-05 02:00:58', 0, '2014-08-11 07:17:11', 0, 1, '', NULL),
(110, 14, 1, 1, 0, 12, 'SON20140805', '2014-08-05', 'asdfa3435', 1, 1, 5, 1, 1, 3.2, 1, 0, '', 6, 0, 74, 165.6, 2925.6, 2925.6, 16, '2014-08-05 02:14:55', 0, '2014-08-11 07:17:06', 0, 1, '', NULL),
(111, 15, 1, 1, 0, 12, 'SON20140805', '2014-08-05', 'asdfa3435', 1, 1, 5, 1, 1, 3.2, 1, 0, '', 6, 0, 74, 165.6, 2925.6, 2925.6, 16, '2014-08-05 02:15:07', 0, '2014-08-11 07:15:45', 0, 1, '', NULL),
(112, 16, 1, 1, 0, 12, 'SON20140805', '2014-08-05', 'asdfa3435', 1, 1, 5, 1, 1, 3.2, 1, 0, '', 6, 0, 74, 165.6, 2925.6, 2925.6, 16, '2014-08-05 02:23:53', 0, '2014-08-11 07:15:37', 0, 1, '', NULL),
(113, 17, 1, 1, 0, 12, 'SON20140805', '2014-08-05', 'sd', 1, 1, 17, 1, 1, 2, 1, 0, 'sdfs', 26, 0, 8, 0, 20, 20, 1, '2014-08-05 02:30:00', 0, '2014-08-11 07:15:34', 0, 0, 'AR20140800000003', NULL),
(114, 18, 1, 2, 0, 12, 'SON20140805', '2014-08-05', 'sds', 1, 1, 17, 1, 1, 3.1305, 1, 0, 'sds', 6, 0, 5, 19.26, 340.26, 340.26, 1, '2014-08-05 07:16:18', 0, '2014-08-11 07:15:28', 0, 0, 'AR20140800000004', NULL),
(115, 19, 1, 2, 0, 12, 'SON20140811', '2014-08-11', 'po-009099546', 1, 1, 5, 2, 1, 3.1305, 1, 0, '', 6, 0, 73, 3, 53, 53, 16, '2014-08-11 06:59:13', 0, '2014-08-11 07:15:22', 0, 0, 'AR20140800000006', NULL),
(116, 20, 1, 2, 0, 12, 'SON20140811', '2014-08-11', 'PO-0987667', 1, 17, 17, 2, 0, 3.1305, 1, 0, '', 30, 0, 74, 19.26, 340.26, 341.26, 16, '2014-08-11 07:19:48', 0, '2014-08-11 08:48:31', 0, 1, '', NULL),
(117, 21, 1, 2, 0, 12, 'SON20140811', '2014-08-11', 'SDS', 1, 17, 17, 1, 0, 3.1305, 1, 0, 'SDS', 7, 0, 74, 19.26, 340.26, 340.26, 1, '2014-08-11 07:22:32', 0, '2014-08-11 07:22:32', 0, 1, '', NULL),
(118, 22, 1, 2, 0, 12, 'SON20140811', '2014-08-11', 'asa', 1, 2, 17, 1, 0, 3.1305, 1, 0, 'sds', 30, 0, 5, 19.26, 340.26, 340.26, 1, '2014-08-11 07:29:04', 0, '2014-08-11 07:29:04', 0, 1, '', NULL),
(119, 23, 1, 2, 0, 12, 'SON20140811', '2014-08-11', 'QW', 2, 17, 17, 1, 0, 3.1305, 1, 0, 'SD', 30, 0, 74, 19.26, 340.26, 340.26, 1, '2014-08-11 07:32:40', 0, '2014-08-11 07:32:40', 0, 1, '', NULL),
(120, 24, 1, 2, 0, 12, 'SON20140811', '2014-08-05', 'AS', 1, 17, 5, 1, 0, 3.1305, 1, 0, 'SD', 30, 0, 74, 19.26, 340.26, 340.26, 1, '2014-08-11 07:37:04', 0, '2014-08-11 07:37:04', 0, 1, '', NULL),
(121, 25, 1, 2, 0, 12, 'SON20140811', '2014-08-11', 'QW', 1, 17, 17, 2, 0, 3.1305, 1, 0, 'A', 26, 0, 5, 0, 1, 1, 1, '2014-08-11 07:38:29', 0, '0000-00-00 00:00:00', 0, 1, '', NULL),
(122, 26, 1, 2, 0, 12, 'SON20140811', '2014-08-11', 'sd', 1, 15, 18, 1, 0, 3.1305, 1, 0, 'sd', 6, 0, 74, 19.26, 340.26, 340.26, 1, '2014-08-11 07:41:12', 0, '2014-08-11 07:41:12', 0, 1, '', NULL),
(123, 27, 1, 2, 0, 12, 'SON20140811', '2014-08-11', 'sdw', 2, 24, 18, 1, 1, 3.1305, 1, 0, 'cvx', 6, 0, 5, 0, 12, 12, 1, '2014-08-11 07:42:43', 0, '0000-00-00 00:00:00', 0, 1, '', NULL),
(124, 28, 1, 2, 0, 12, 'SON20140811', '2014-08-11', 'SD', 1, 15, 18, 1, 1, 3.1305, 1, 0, 'XC', 6, 0, 8, 0, 1, 1, 1, '2014-08-11 07:47:27', 0, '0000-00-00 00:00:00', 0, 1, '', NULL),
(125, 29, 1, 1, 0, 15, 'SON20140811', '2014-08-11', 'SA', 1, 17, 18, 1, 0, 12, 1, 0, 'SD', 6, 0, 74, 21.6, 381.6, 381.6, 1, '2014-08-11 07:49:46', 0, '0000-00-00 00:00:00', 0, 1, '', NULL),
(126, 1, 15, 2, 0, 18, 'SON', '2014-08-11', 'cust po 0121234124', 3, 19, 17, 2, 2, 3.1305, 14, 0, '', 9, 0, 8, 4.2, 74.2, 74.2, 16, '2014-08-11 07:57:52', 0, '2014-08-15 09:12:26', 0, 0, 'AR20140300000002', NULL),
(127, 30, 1, 1, 0, 15, 'SON20140811', '2014-08-11', 'DA', 2, 17, 7, 1, 0, 1, 1, 0, 'DS', 6, 0, 5, 0, 1, 1, 1, '2014-08-11 08:12:31', 0, '0000-00-00 00:00:00', 0, 1, '', NULL),
(128, 31, 1, 1, 0, 15, 'SON20140811', '2014-08-11', 'e', 2, 2, 7, 1, 2, 2, 1, 0, 'er', 30, 0, 74, 0, 1, 1, 1, '2014-08-11 08:15:48', 0, '0000-00-00 00:00:00', 0, 1, '', NULL),
(129, 32, 1, 1, 0, 15, 'SON20140811', '2014-08-11', 'we', 1, 17, 5, 1, 2, 1, 1, 0, 'wq', 6, 0, 74, 73.2, 1293.2, 1293.2, 1, '2014-08-11 08:17:09', 0, '0000-00-00 00:00:00', 0, 1, '', NULL),
(130, 33, 1, 1, 0, 15, 'SON20140811', '2014-08-11', 'sadf34', 1, 1, 5, 1, 0, 0, 1, 0, '', 30, 0, 74, 0, 36.04, 36.04, 33, '2014-08-11 08:18:38', 0, '0000-00-00 00:00:00', 0, 1, '', NULL),
(131, 34, 1, 1, 0, 15, 'SON20140811', '2014-08-11', 'asdfasf242134', 1, 2, 5, 1, 0, 0, 1, 0, '', 6, 0, 74, 0, 0, 0, 33, '2014-08-11 10:35:42', 0, '0000-00-00 00:00:00', 0, 1, '', NULL),
(132, 35, 1, 1, 0, 15, 'SON20140811', '2014-08-11', 'asdfasf242134', 1, 2, 5, 1, 0, 0, 1, 0, '', 6, 0, 74, 0, 0, 0, 33, '2014-08-11 10:35:54', 0, '0000-00-00 00:00:00', 0, 1, '', NULL),
(133, 36, 1, 1, 0, 15, 'SON20140811', '2014-08-11', 'asdfasf242134', 1, 2, 5, 1, 0, 0, 1, 0, '', 6, 0, 74, 0, 0, 0, 33, '2014-08-11 10:36:57', 0, '0000-00-00 00:00:00', 0, 1, '', NULL),
(134, 37, 1, 1, 0, 15, 'SON20140811', '2014-08-11', 'asdfasf242134', 1, 2, 5, 1, 0, 0, 1, 0, '', 6, 0, 74, 0, 0, 0, 33, '2014-08-11 10:37:13', 0, '0000-00-00 00:00:00', 0, 1, '', NULL),
(135, 38, 1, 1, 0, 15, 'SON20140811', '2014-08-11', 'asdfasf242134', 1, 2, 5, 1, 0, 0, 1, 0, '', 6, 0, 74, 0, 0, 0, 33, '2014-08-11 10:37:31', 0, '0000-00-00 00:00:00', 0, 1, '', NULL),
(136, 39, 1, 1, 0, 15, 'SON20140811', '2014-08-11', 'asdfasf242134', 1, 2, 5, 1, 0, 0, 1, 0, '', 6, 0, 74, 0, 0, 0, 33, '2014-08-11 10:38:02', 0, '0000-00-00 00:00:00', 0, 1, '', NULL),
(137, 40, 1, 1, 0, 15, 'SON20140811', '2014-08-11', 'asdfasf242134', 1, 2, 5, 1, 0, 0, 1, 0, '', 6, 0, 74, 0, 0, 0, 33, '2014-08-11 10:38:13', 0, '0000-00-00 00:00:00', 0, 1, '', NULL),
(138, 41, 1, 1, 0, 15, 'SON20140811', '2014-08-11', 'asdfasf242134', 1, 2, 5, 1, 0, 0, 1, 0, '', 6, 0, 74, 0, 0, 0, 33, '2014-08-11 10:44:03', 0, '0000-00-00 00:00:00', 0, 1, '', NULL),
(139, 42, 1, 1, 0, 12, 'SON20140812', '2014-08-12', 'ASDFAR2EQWER', 1, 1, 5, 1, 1, 3.23, 15, 0, '', 30, 1, 74, 72, 1272, 1272, 33, '2014-08-12 07:56:53', 0, '2014-08-12 07:58:47', 0, 1, '', NULL),
(140, 43, 1, 1, 0, 12, 'SON20140812', '2014-08-12', 'asfasfd234', 1, 1, 5, 2, 1, 3.23, 15, 0, '', 6, 1, 73, 72, 1272, 1272, 33, '2014-08-12 08:02:32', 0, '0000-00-00 00:00:00', 0, 1, '', NULL),
(141, 44, 1, 2, 0, 15, 'SON20140813', '2014-08-13', 'sdfgdsf4563456', 1, 1, 17, 14, 2, 3, 15, 0, 'ssdfgsdfgsdgf', 6, 1, 73, 288.9, 5103.9, 5103.9, 33, '2014-08-13 10:47:43', 0, '2014-08-13 10:47:43', 0, 1, '', NULL),
(142, 1, 84, 1, 0, 35, 'SON', '2014-01-16', 'dfbnrt6757', 10, 26, 17, 18, 0, 34, 13, 0, '', 29, 0, 73, 0, 0, 0, 33, '2014-08-13 11:12:11', 0, '0000-00-00 00:00:00', 0, 1, '', NULL),
(143, 2, 84, 1, 0, 35, 'SON', '2014-01-16', 'dfbnrt6757', 10, 26, 17, 18, 0, 34, 13, 0, '', 29, 0, 73, 0, 0, 0, 33, '2014-08-13 11:12:33', 0, '0000-00-00 00:00:00', 0, 1, '', NULL),
(144, 3, 84, 1, 0, 35, 'SON', '2014-01-16', 'dfbnrt6757', 10, 26, 17, 0, 0, 34, 13, 0, '', 29, 0, 73, 0, 0, 0, 33, '2014-08-13 11:12:33', 0, '2014-08-13 11:12:56', 0, 1, '', NULL),
(145, 45, 1, 2, 0, 12, 'SON20140815', '2014-08-15', 'sa', 1, 1, 17, 7, 1, 12, 15, 0, 'asa', 30, 0, 74, 1.1, 21.1, 21.1, 1, '2014-08-15 06:44:39', 0, '2014-08-15 10:02:14', 0, 0, 'AR20140800000009', NULL),
(146, 2, 15, 2, 0, 17, 'SON', '2014-08-15', 'asfdasf867', 3, 19, 17, 5, 1, 3.45, 14, 0, '', 12, 0, 5, 88.44000000000001, 255.4, 255.4, 33, '2014-08-15 09:46:33', 0, '2014-08-18 07:46:21', 0, 1, '', NULL),
(147, 4, 84, 1, 0, 0, 'SON', '2014-01-18', '', 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 0, 0, 0, 0, 0, 33, '2014-08-18 01:28:34', 0, '0000-00-00 00:00:00', 0, 1, '', NULL),
(148, 5, 84, 1, 0, 35, 'SON', '2014-01-18', 'ADDF2354235', 10, 26, 17, 18, 0, 0, 13, 0, '', 29, 0, 5, 0, 0, 0, 33, '2014-08-18 01:29:43', 0, '0000-00-00 00:00:00', 0, 1, '', NULL),
(149, 6, 84, 2, 0, 35, 'SON', '2014-01-15', 'afsgafg3543', 10, 26, 17, 18, 0, 3.34, 13, 0, 'fs dfgsf sdfgsdfg sdgf', 29, 0, 74, 74.04, 1308.04, 1308.04, 33, '2014-08-18 02:41:58', 0, '2014-08-18 02:41:58', 0, 1, '', NULL),
(150, 46, 1, 1, 0, 12, 'SON20140818', '2014-08-18', 'sdfs35635', 1, 1, 5, 8, 1, 3.23, 15, 0, '', 6, 0, 74, 0, 0, 0, 33, '2014-08-18 03:03:29', 0, '0000-00-00 00:00:00', 0, 1, '', NULL),
(151, 47, 1, 1, 0, 12, 'SON20140818', '2014-08-18', 'asf3453525', 1, 1, 5, 8, 1, 3.23, 15, 0, '', 30, 1, 6, 0, 0, 0, 33, '2014-08-18 03:12:50', 0, '0000-00-00 00:00:00', 0, 1, '', NULL),
(152, 48, 1, 1, 0, 16, 'SON20140818', '2014-08-18', 'asdf234523', 1, 1, 17, 15, 1, 3.23, 15, 0, '', 30, 0, 74, 0, 0, 0, 33, '2014-08-18 03:16:31', 0, '2014-08-18 03:49:19', 0, 1, '', NULL),
(153, 7, 84, 1, 0, 35, 'SON', '2014-08-18', 'WDADS234234', 10, 26, 17, 18, 10, 0, 13, 0, '', 29, 0, 74, 0, 0, 0, 33, '2014-08-18 04:50:03', 0, '0000-00-00 00:00:00', 0, 1, '', NULL),
(154, 8, 84, 1, 0, 35, 'SON', '2014-08-18', 'svcsf2345234', 10, 26, 5, 19, 10, 0, 13, 0, '', 29, 0, 74, 0, 0, 0, 33, '2014-08-18 04:51:33', 0, '0000-00-00 00:00:00', 0, 1, '', NULL),
(155, 9, 84, 1, 0, 35, 'SON', '2014-01-15', 'fasdfas245245', 10, 26, 5, 18, 10, 0, 13, 0, '', 29, 1, 6, 0, 0, 0, 33, '2014-08-18 04:54:07', 0, '0000-00-00 00:00:00', 0, 1, '', NULL);

--
-- Triggers `comp_sales_invoice`
--
DROP TRIGGER IF EXISTS `trigger_before_insert_sinv_add_serialNo`;
DELIMITER //
CREATE TRIGGER `trigger_before_insert_sinv_add_serialNo` BEFORE INSERT ON `comp_sales_invoice`
 FOR EACH ROW set new.serialNo = (select nextSerialNo 
			   from view_serial_comp_sales_invoice
			   where companyID = new.companyID)
//
DELIMITER ;

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

--
-- Table structure for table `comp_sales_invoice_charges`
--

CREATE TABLE IF NOT EXISTS `comp_sales_invoice_charges` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `invoiceID` int(11) NOT NULL,
  `lineNo` int(11) NOT NULL,
  `accountNoID` int(11) NOT NULL,
  `chargeDescription` text NOT NULL,
  `amountExcludedTax` double NOT NULL,
  `taxID` int(11) NOT NULL,
  `taxRate` double NOT NULL,
  `taxAmount` double NOT NULL,
  `amountIncludedTax` double NOT NULL,
  `drAccountID` int(11) NOT NULL,
  `crAccountID` int(11) NOT NULL,
  `drTaxAccountID` int(11) NOT NULL,
  `crTaxAccountID` 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 '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=114 ;

--
-- Dumping data for table `comp_sales_invoice_charges`
--

INSERT INTO `comp_sales_invoice_charges` (`ID`, `invoiceID`, `lineNo`, `accountNoID`, `chargeDescription`, `amountExcludedTax`, `taxID`, `taxRate`, `taxAmount`, `amountIncludedTax`, `drAccountID`, `crAccountID`, `drTaxAccountID`, `crTaxAccountID`, `createdBy`, `createdTS`, `updatedBy`, `updatedTS`) VALUES
(37, 18, 1, 86, 'delivery charges', 1212, 9, 0, 0, 1212, 0, 0, 0, 0, 16, '2014-06-18 02:19:53', 0, '2014-06-24 00:42:54'),
(38, 20, 0, 101, '11sd', 0, 1, 6, 0.72, 12, 0, 0, 0, 0, 16, '2014-06-27 07:11:30', 0, '0000-00-00 00:00:00'),
(39, 22, 0, 101, '1', 0, 1, 6, 0.06, 1, 0, 0, 0, 0, 16, '2014-06-27 07:27:41', 0, '0000-00-00 00:00:00'),
(40, 23, 0, 88, 'wew', 1, 18, 6, 0.72, 12, 0, 0, 0, 0, 16, '2014-06-27 07:34:11', 0, '0000-00-00 00:00:00'),
(41, 26, 0, 86, 'we', 0, 15, 6, 0.06, 1, 0, 0, 0, 0, 16, '2014-06-27 07:47:23', 0, '0000-00-00 00:00:00'),
(42, 27, 0, 88, 'qw', 0, 15, 6, 0.06, 1, 0, 0, 0, 0, 16, '2014-06-27 07:48:34', 0, '0000-00-00 00:00:00'),
(43, 30, 0, 100, 'we', 0, 1, 6, 0.72, 12, 0, 0, 0, 0, 16, '2014-06-30 00:44:08', 0, '0000-00-00 00:00:00'),
(44, 31, 1, 100, '111111111', 0, 1, 6, 0.72, 12, 0, 0, 0, 0, 16, '2014-06-30 01:02:05', 16, '2014-06-30 03:22:57'),
(46, 32, 1, 102, 'qwqw', 0, 5, 0, 0, 1, 0, 0, 0, 0, 16, '2014-06-30 03:45:03', 0, '0000-00-00 00:00:00'),
(47, 21, 1, 100, 'asa', 0, 5, 0, 1, 1, 0, 0, 0, 0, 16, '2014-07-03 04:28:29', 0, '2014-07-07 02:33:20'),
(48, 35, 1, 101, 'asdfasdfa fas', 23425, 1, 6, 1405.5, 24830.5, 0, 0, 0, 0, 16, '2014-07-04 03:43:21', 0, '0000-00-00 00:00:00'),
(49, 36, 1, 101, 'adadf12313', 234, 1, 6, 14.04, 248.04, 0, 0, 0, 0, 16, '2014-07-04 03:45:10', 0, '0000-00-00 00:00:00'),
(50, 36, 2, 102, 'asdfas245235342', 0, 1, 6, 207.18, 3453, 0, 0, 0, 0, 16, '2014-07-04 03:47:24', 0, '0000-00-00 00:00:00'),
(51, 37, 1, 101, 'ASDFASDF', 24545, 1, 6, 1472.7, 26017.7, 0, 0, 0, 0, 16, '2014-07-04 03:53:16', 0, '0000-00-00 00:00:00'),
(52, 38, 1, 100, 'trr', 300, 1, 6, 18, 318, 0, 0, 0, 0, 16, '2014-07-07 06:06:10', 16, '2014-07-08 09:06:34'),
(53, 39, 1, 100, 'sd', 1, 5, 0, 0, 1, 0, 0, 0, 0, 16, '2014-07-07 06:13:13', 0, '0000-00-00 00:00:00'),
(54, 39, 2, 101, 'hasdfasfd245435', 234, 1, 6, 14.04, 248.04, 0, 0, 0, 0, 16, '2014-07-07 06:13:50', 16, '2014-07-09 07:51:24'),
(55, 41, 1, 101, 'sfgsdfg35356', 0, 1, 6, 272.7, 4545, 0, 0, 0, 0, 16, '2014-07-07 06:45:33', 0, '0000-00-00 00:00:00'),
(56, 39, 3, 102, 'WWWWWWWWWWW', 1, 2, 0, 0, 1, 0, 0, 0, 0, 16, '2014-07-07 06:55:27', 16, '2014-07-07 06:59:17'),
(58, 19, 1, 101, 'asdfasd324523', 456, 1, 6, 27.36, 483.36, 0, 0, 0, 0, 16, '2014-07-08 02:21:57', 0, '0000-00-00 00:00:00'),
(59, 19, 2, 101, 'sadf352345', 654, 1, 6, 39.24, 693.24, 0, 0, 0, 0, 16, '2014-07-08 02:22:26', 0, '0000-00-00 00:00:00'),
(81, 75, 1, 100, 'trr', 0, 1, 6, 0.72, 12, 0, 0, 0, 0, 16, '2014-07-07 06:06:10', 0, '0000-00-00 00:00:00'),
(84, 76, 1, 100, 'trr', 300, 1, 6, 18, 318, 0, 0, 0, 0, 16, '2014-07-07 06:06:10', 16, '2014-07-08 09:06:34'),
(85, 75, 2, 101, 'safg3245', 456, 1, 6, 27.36, 483.36, 0, 0, 0, 0, 16, '2014-07-09 03:07:01', 0, '0000-00-00 00:00:00'),
(86, 0, 2, 101, 'afdasdf345345', 456, 1, 6, 27.36, 483.36, 0, 0, 0, 0, 16, '2014-07-11 01:20:10', 0, '0000-00-00 00:00:00'),
(87, 29, 1, 101, 'sadf2345', 400, 1, 6, 24, 424, 0, 0, 0, 0, 16, '2014-07-11 02:22:15', 16, '2014-07-11 02:23:16'),
(91, 77, 1, 101, 'sadf2345', 400, 1, 6, 24, 424, 0, 0, 0, 0, 16, '2014-07-11 02:22:15', 16, '2014-07-11 02:23:16'),
(92, 78, 1, 101, 'dsfgsd2345', 345, 1, 6, 20.7, 365.7, 0, 0, 0, 0, 16, '2014-07-11 08:25:59', 0, '0000-00-00 00:00:00'),
(93, 79, 1, 101, 'asfd23452', 456, 1, 6, 27.36, 483.36, 0, 0, 0, 0, 16, '2014-07-11 08:38:18', 0, '0000-00-00 00:00:00'),
(94, 80, 1, 101, 'asfasdf3245', 466, 1, 6, 27.96, 493.96, 0, 0, 0, 0, 16, '2014-07-11 08:51:42', 0, '0000-00-00 00:00:00'),
(95, 81, 1, 101, 'asfsa234523', 464, 1, 6, 27.84, 491.84, 0, 0, 0, 0, 16, '2014-07-11 08:59:06', 0, '0000-00-00 00:00:00'),
(96, 81, 2, 102, 'qwer245', 0, 1, 6, 27.18, 453, 0, 0, 0, 0, 16, '2014-07-11 08:59:34', 0, '0000-00-00 00:00:00'),
(97, 89, 1, 101, 'asfsad3452354', 453, 1, 6, 27.18, 480.18, 0, 0, 0, 0, 16, '2014-07-14 00:47:46', 0, '0000-00-00 00:00:00'),
(98, 92, 1, 100, 'sds', 1.1111111111111111e20, 1, 6, 6.666666666666668e18, 1.1777777777777779e20, 0, 0, 0, 0, 16, '2014-07-14 06:58:13', 0, '0000-00-00 00:00:00'),
(100, 95, 1, 101, 'asdf2345', 0, 1, 6, 2.7, 45, 0, 0, 0, 0, 16, '2014-07-16 04:30:27', 0, '0000-00-00 00:00:00'),
(101, 96, 1, 100, 'sds', 1.1111111111111111e20, 1, 6, 6.666666666666668e18, 1.1777777777777779e20, 0, 0, 0, 0, 16, '2014-07-14 06:58:13', 0, '0000-00-00 00:00:00'),
(102, 102, 1, 101, 'swdew', 112, 1, 6, 6.72, 0, 0, 0, 0, 0, 1, '2014-08-05 02:00:22', 0, '0000-00-00 00:00:00'),
(103, 103, 1, 101, 'swdew', 112, 1, 6, 6.72, 0, 0, 0, 0, 0, 1, '2014-08-05 02:00:25', 0, '0000-00-00 00:00:00'),
(104, 104, 1, 101, 'swdew', 112, 1, 6, 6.72, 0, 0, 0, 0, 0, 1, '2014-08-05 02:00:36', 0, '0000-00-00 00:00:00'),
(105, 105, 1, 101, 'swdew', 112, 1, 6, 6.72, 0, 0, 0, 0, 0, 1, '2014-08-05 02:00:38', 0, '0000-00-00 00:00:00'),
(106, 123, 1, 102, 'sds', 12, 4, 0, 0, 12, 0, 0, 0, 0, 1, '2014-08-11 07:42:43', 0, '0000-00-00 00:00:00'),
(107, 127, 1, 101, 'SDS', 1, 5, 0, 0, 0, 0, 0, 0, 0, 1, '2014-08-11 08:12:31', 0, '0000-00-00 00:00:00'),
(108, 128, 1, 101, 'we', 1, 5, 0, 0, 0, 0, 0, 0, 0, 1, '2014-08-11 08:15:48', 0, '0000-00-00 00:00:00'),
(109, 130, 1, 101, 'sdsdf', 34, 1, 6, 2.04, 0, 0, 0, 0, 0, 33, '2014-08-11 08:18:39', 0, '0000-00-00 00:00:00'),
(110, 116, 1, 102, 'H', 1, 4, 0, 0, 1, 0, 0, 0, 0, 1, '2014-08-11 08:48:31', 0, '0000-00-00 00:00:00'),
(111, 126, 1, 290, 'sewa lori', 50, 35, 6, 3, 53, 0, 0, 0, 0, 16, '2014-08-15 07:37:28', 0, '0000-00-00 00:00:00'),
(112, 146, 1, 290, 'sewa lori', 1, 35, 6, 74.04, 1, 0, 0, 0, 0, 33, '2014-08-15 09:47:02', 16, '2014-08-18 07:46:21'),
(113, 149, 1, 27493, 'asfgsdf3465345', 1234, 98, 6, 74.04, 1308.04, 0, 0, 0, 0, 33, '2014-08-18 02:41:58', 0, '0000-00-00 00:00:00');

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

--
-- Table structure for table `comp_sales_invoice_detail`
--

CREATE TABLE IF NOT EXISTS `comp_sales_invoice_detail` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `invoiceID` int(11) NOT NULL,
  `doID` int(11) NOT NULL,
  `lineNo` int(11) NOT NULL,
  `itemID` int(11) NOT NULL,
  `quantity` int(11) NOT NULL,
  `unitPrice` double NOT NULL,
  `amountExcludedTax` double NOT NULL,
  `taxID` int(11) NOT NULL,
  `taxRate` double NOT NULL,
  `taxAmount` double NOT NULL,
  `amountIncludedTax` double NOT NULL,
  `accountID` int(11) NOT NULL,
  `createdBy` int(11) NOT NULL,
  `createdTS` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `updatedBy` int(11) NOT NULL,
  `updatedTS` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=186 ;

--
-- Dumping data for table `comp_sales_invoice_detail`
--

INSERT INTO `comp_sales_invoice_detail` (`ID`, `invoiceID`, `doID`, `lineNo`, `itemID`, `quantity`, `unitPrice`, `amountExcludedTax`, `taxID`, `taxRate`, `taxAmount`, `amountIncludedTax`, `accountID`, `createdBy`, `createdTS`, `updatedBy`, `updatedTS`) VALUES
(21, 18, 0, 1, 7, 1, 1212, 1212, 1, 6, 72.72, 1284.72, 0, 16, '2014-07-07 01:54:09', 0, '0000-00-00 00:00:00'),
(22, 18, 0, 2, 1, 1, 12, 12, 1, 6, 0.72, 12.72, 0, 16, '2014-06-18 03:52:34', 0, '0000-00-00 00:00:00'),
(23, 19, 0, 0, 1, 1, 13, 13, 4, 0, 0, 13, 0, 16, '2014-06-26 06:49:57', 0, '0000-00-00 00:00:00'),
(24, 20, 0, 0, 1, 1, 12, 12, 1, 6, 0.72, 12.72, 0, 16, '2014-06-27 07:11:02', 0, '0000-00-00 00:00:00'),
(25, 20, 0, 0, 4, 1, 12, 12, 3, 0, 0, 12, 0, 16, '2014-06-27 07:11:17', 0, '0000-00-00 00:00:00'),
(26, 21, 0, 0, 1, 1, 1, 1, 0, 1, 0.01, 1.01, 0, 16, '2014-06-27 07:22:31', 0, '0000-00-00 00:00:00'),
(27, 22, 0, 0, 1, 1, 1, 1, 1, 6, 0.06, 1.06, 0, 16, '2014-06-27 07:27:12', 0, '0000-00-00 00:00:00'),
(28, 22, 0, 0, 7, 1, 1, 1, 11, 10, 0.1, 1.1, 0, 16, '2014-06-27 07:27:29', 0, '0000-00-00 00:00:00'),
(29, 24, 0, 0, 1, 1, 1, 1, 2, 0, 0, 1, 0, 16, '2014-06-27 07:34:59', 0, '0000-00-00 00:00:00'),
(30, 25, 0, 0, 8, 1, 1, 1, 3, 0, 0, 1, 0, 16, '2014-06-27 07:46:47', 0, '0000-00-00 00:00:00'),
(31, 28, 0, 0, 9, 2, 652, 1304, 1, 6, 78.24, 1382.24, 0, 16, '2014-06-30 00:35:53', 0, '0000-00-00 00:00:00'),
(32, 28, 0, 0, 10, 1, 12, 12, 0, 1, 0.12, 12.12, 0, 16, '2014-06-30 00:37:45', 0, '0000-00-00 00:00:00'),
(33, 29, 0, 0, 9, 1, 652, 652, 5, 0, 0, 652, 0, 16, '2014-07-11 02:27:17', 16, '0000-00-00 00:00:00'),
(35, 31, 0, 2, 8, 1, 0, 12, 10, 0, 0.72, 12.72, 0, 16, '2014-06-30 02:36:39', 16, '0000-00-00 00:00:00'),
(36, 32, 0, 1, 9, 1, 652, 652, 5, 0, 0, 652, 0, 16, '2014-06-30 03:42:50', 0, '0000-00-00 00:00:00'),
(37, 32, 0, 2, 10, 1, 1, 1, 0, 6, 0.06, 1.06, 0, 16, '2014-06-30 03:43:49', 0, '0000-00-00 00:00:00'),
(38, 33, 0, 1, 1, 3, 321, 963, 12, 6, 57.78, 1020.78, 0, 16, '2014-07-02 06:40:16', 0, '0000-00-00 00:00:00'),
(39, 34, 0, 1, 1, 8, 321, 2568, 12, 6, 154.08, 2722.08, 0, 16, '2014-07-02 07:54:56', 0, '0000-00-00 00:00:00'),
(40, 34, 0, 2, 7, 3, 120, 360, 14, 6, 21.6, 381.6, 0, 16, '2014-07-02 07:55:49', 0, '0000-00-00 00:00:00'),
(41, 37, 0, 1, 1, 120, 120, 14400, 12, 0, 720, 15120, 0, 16, '2014-07-04 03:53:16', 0, '0000-00-00 00:00:00'),
(42, 37, 0, 2, 2, 250, 90, 22500, 13, 0, 1350, 23850, 0, 16, '2014-07-04 03:53:16', 0, '0000-00-00 00:00:00'),
(47, 31, 0, 3, 7, 1, 1, 1, 0, 0, 0, 1, 0, 16, '2014-07-07 05:52:21', 16, '0000-00-00 00:00:00'),
(48, 38, 0, 1, 7, 155, 45, 6, 1, 6, 418.5, 7, 0, 16, '2014-07-08 09:06:01', 16, '0000-00-00 00:00:00'),
(49, 39, 0, 1, 1, 1, 321, 321, 1, 6, 19.26, 340.26, 0, 16, '2014-07-07 06:16:42', 16, '0000-00-00 00:00:00'),
(50, 39, 0, 2, 4, 2, 1, 2, 0, 0, 0, 2, 0, 16, '2014-07-07 06:16:08', 0, '0000-00-00 00:00:00'),
(51, 39, 0, 3, 1, 1, 321, 321, 1, 6, 19.26, 340.26, 0, 16, '2014-07-07 06:29:34', 0, '0000-00-00 00:00:00'),
(52, 40, 0, 1, 1, 10, 120, 1200, 1, 0, 72, 1272, 0, 16, '2014-07-07 06:42:29', 0, '0000-00-00 00:00:00'),
(53, 40, 0, 2, 2, 2300, 230, 529000, 1, 0, 31740, 560740, 0, 16, '2014-07-07 06:42:29', 0, '0000-00-00 00:00:00'),
(54, 41, 0, 1, 1, 1200, 30, 36000, 1, 0, 2160, 38160, 0, 16, '2014-07-07 06:45:19', 0, '0000-00-00 00:00:00'),
(55, 41, 0, 2, 8, 120, 122, 14640, 10, 0, 878.4, 15518.4, 0, 16, '2014-07-07 06:45:19', 0, '0000-00-00 00:00:00'),
(93, 75, 0, 1, 7, 1, 1, 1, 1, 6, 0.06, 1.06, 0, 16, '2014-07-09 02:10:00', 16, '0000-00-00 00:00:00'),
(94, 76, 0, 1, 7, 155, 45, 6, 1, 6, 418.5, 7, 0, 16, '2014-07-08 09:06:01', 16, '0000-00-00 00:00:00'),
(95, 75, 0, 2, 1, 11, 4, 44, 11, 10, 4.4, 48.4, 0, 16, '2014-07-09 03:13:35', 16, '0000-00-00 00:00:00'),
(96, 155, 0, 1, 1, 15, 321, 4815, 1, 6, 288.9, 5103.9, 0, 16, '2014-07-09 06:58:54', 0, '0000-00-00 00:00:00'),
(97, 0, 0, 1, 1, 15, 321, 4, 1, 6, 288.9, 5, 0, 16, '2014-07-10 08:49:38', 16, '0000-00-00 00:00:00'),
(98, 29, 0, 1, 7, 44, 45, 1980, 1, 6, 0, 1980, 0, 16, '2014-07-11 02:29:40', 0, '0000-00-00 00:00:00'),
(99, 29, 0, 2, 7, 45, 34, 1530, 1, 6, 91.8, 1621.8, 0, 16, '2014-07-11 02:31:12', 0, '0000-00-00 00:00:00'),
(100, 29, 0, 3, 1, 5, 324, 1620, 1, 6, 97.2, 1717.2, 0, 16, '2014-07-11 02:31:46', 0, '0000-00-00 00:00:00'),
(103, 77, 0, 0, 9, 1, 652, 652, 5, 0, 0, 652, 0, 16, '2014-07-11 02:27:17', 16, '0000-00-00 00:00:00'),
(104, 77, 0, 1, 7, 44, 45, 1980, 1, 6, 0, 1980, 0, 16, '2014-07-11 02:29:40', 0, '0000-00-00 00:00:00'),
(105, 77, 0, 2, 7, 45, 34, 1530, 1, 6, 91.8, 1621.8, 0, 16, '2014-07-11 02:31:12', 0, '0000-00-00 00:00:00'),
(106, 77, 0, 3, 1, 5, 324, 1620, 1, 6, 97.2, 1717.2, 0, 16, '2014-07-11 02:31:46', 0, '0000-00-00 00:00:00'),
(107, 78, 0, 1, 1, 120, 120, 14400, 1, 0, 864, 15264, 0, 16, '2014-07-11 08:25:59', 0, '0000-00-00 00:00:00'),
(108, 78, 0, 2, 2, 250, 90, 22500, 1, 0, 1350, 23850, 0, 16, '2014-07-11 08:25:59', 0, '0000-00-00 00:00:00'),
(109, 78, 0, 3, 1, 10, 120, 1200, 1, 0, 72, 1272, 0, 16, '2014-07-11 08:25:59', 0, '0000-00-00 00:00:00'),
(110, 78, 0, 4, 2, 2300, 230, 529000, 1, 0, 31740, 560740, 0, 16, '2014-07-11 08:25:59', 0, '0000-00-00 00:00:00'),
(111, 79, 0, 1, 1, 120, 120, 14400, 1, 0, 864, 15264, 0, 16, '2014-07-11 08:38:18', 0, '0000-00-00 00:00:00'),
(112, 79, 0, 2, 2, 250, 90, 22500, 1, 0, 1350, 23850, 0, 16, '2014-07-11 08:38:18', 0, '0000-00-00 00:00:00'),
(113, 79, 0, 3, 1, 10, 120, 1200, 1, 0, 72, 1272, 0, 16, '2014-07-11 08:38:18', 0, '0000-00-00 00:00:00'),
(114, 79, 0, 4, 2, 2300, 230, 529000, 1, 0, 31740, 560740, 0, 16, '2014-07-11 08:38:18', 0, '0000-00-00 00:00:00'),
(115, 80, 0, 1, 1, 120, 120, 14400, 1, 0, 864, 15264, 0, 16, '2014-07-11 08:51:41', 0, '0000-00-00 00:00:00'),
(116, 81, 0, 1, 2, 250, 90, 22500, 1, 0, 1350, 23850, 0, 16, '2014-07-11 08:59:06', 0, '0000-00-00 00:00:00'),
(117, 81, 0, 2, 2, 2300, 230, 529000, 1, 0, 31740, 560740, 0, 16, '2014-07-11 08:59:06', 0, '0000-00-00 00:00:00'),
(118, 82, 0, 1, 2, 250, 90, 22500, 1, 0, 1350, 23850, 0, 16, '2014-07-11 09:00:31', 0, '0000-00-00 00:00:00'),
(119, 82, 0, 2, 2, 2300, 230, 529000, 1, 0, 31740, 560740, 0, 16, '2014-07-11 09:00:31', 0, '0000-00-00 00:00:00'),
(120, 83, 0, 1, 1, 10, 120, 1200, 1, 0, 72, 1272, 0, 16, '2014-07-11 09:01:30', 0, '0000-00-00 00:00:00'),
(121, 84, 0, 1, 1, 10, 120, 1200, 1, 0, 72, 1272, 0, 16, '2014-07-11 09:02:05', 0, '0000-00-00 00:00:00'),
(122, 85, 0, 1, 2, 250, 90, 22500, 1, 0, 1350, 23850, 0, 16, '2014-07-11 09:03:17', 0, '0000-00-00 00:00:00'),
(123, 85, 0, 2, 1, 10, 120, 1200, 1, 0, 72, 1272, 0, 16, '2014-07-11 09:03:17', 0, '0000-00-00 00:00:00'),
(124, 86, 0, 1, 2, 2300, 230, 529000, 1, 0, 31740, 560740, 0, 16, '2014-07-11 09:08:40', 0, '0000-00-00 00:00:00'),
(125, 87, 0, 1, 8, 2300, 230, 529000, 1, 0, 31740, 560740, 0, 16, '2014-07-11 09:29:31', 0, '0000-00-00 00:00:00'),
(126, 88, 0, 1, 1, 120, 120, 14400, 1, 0, 864, 15264, 0, 16, '2014-07-11 09:30:18', 0, '0000-00-00 00:00:00'),
(127, 88, 0, 2, 3, 250, 90, 22500, 1, 0, 1350, 23850, 0, 16, '2014-07-11 09:30:18', 0, '0000-00-00 00:00:00'),
(128, 89, 0, 1, 1, 120, 120, 14400, 1, 0, 864, 15264, 0, 16, '2014-07-14 00:47:46', 0, '0000-00-00 00:00:00'),
(129, 89, 0, 2, 3, 250, 90, 22500, 1, 0, 1350, 23850, 0, 16, '2014-07-14 00:47:46', 0, '0000-00-00 00:00:00'),
(130, 90, 0, 1, 7, 10, 120, 1200, 1, 0, 72, 1272, 0, 16, '2014-07-14 00:50:58', 0, '0000-00-00 00:00:00'),
(131, 91, 0, 1, 7, 1, 1, 1, 0, 0, 0, 1, 0, 16, '2014-07-14 06:42:06', 0, '0000-00-00 00:00:00'),
(132, 91, 0, 2, 10, 1, 1, 1, 0, 6, 0.06, 1.06, 0, 16, '2014-07-14 06:48:08', 0, '0000-00-00 00:00:00'),
(133, 92, 0, 1, 7, 1, 1, 1, 0, 0, 0, 1, 0, 16, '2014-07-14 06:55:31', 0, '0000-00-00 00:00:00'),
(134, 92, 0, 2, 1, 1, 321, 321, 1, 6, 19.26, 340.26, 0, 16, '2014-07-14 06:56:35', 0, '0000-00-00 00:00:00'),
(135, 93, 0, 1, 7, 1, 1, 1, 1, 6, 0.06, 1.06, 0, 16, '2014-07-14 07:08:01', 0, '0000-00-00 00:00:00'),
(136, 94, 0, 1, 7, 1, 1, 1, 0, 0, 0, 1, 0, 16, '2014-07-14 06:42:06', 0, '0000-00-00 00:00:00'),
(137, 94, 0, 2, 10, 1, 1, 1, 0, 6, 0.06, 1.06, 0, 16, '2014-07-14 06:48:08', 0, '0000-00-00 00:00:00'),
(138, 95, 1, 1, 1, 60, 120, 7200, 1, 0, 432, 7632, 0, 16, '2014-07-16 04:30:49', 0, '0000-00-00 00:00:00'),
(139, 96, 0, 1, 7, 1, 1, 1, 0, 0, 0, 1, 0, 16, '2014-07-14 06:55:31', 0, '0000-00-00 00:00:00'),
(140, 96, 0, 2, 1, 1, 321, 321, 1, 6, 19.26, 340.26, 0, 16, '2014-07-14 06:56:35', 0, '0000-00-00 00:00:00'),
(141, 98, 0, 1, 1, 1, 321, 321, 1, 6, 19.26, 340.26, 0, 1, '2014-08-01 03:46:15', 0, '0000-00-00 00:00:00'),
(142, 99, 0, 1, 1, 1, 321, 321, 1, 6, 19.26, 340.26, 0, 1, '2014-08-01 03:46:15', 0, '0000-00-00 00:00:00'),
(143, 100, 0, 1, 1, 1, 321, 321, 1, 6, 19.26, 340.26, 0, 1, '2014-08-01 03:46:15', 0, '0000-00-00 00:00:00'),
(144, 100, 0, 2, 1, 3, 321, 963, 1, 6, 57.78, 1020.78, 0, 16, '2014-08-04 06:32:01', 0, '0000-00-00 00:00:00'),
(145, 101, 1, 1, 7, 500, 15, 7500, 0, 0, 0, 7500, 0, 1, '2014-08-05 02:00:09', 0, '0000-00-00 00:00:00'),
(146, 101, 4, 2, 1, 10, 120, 1200, 1, 0, 72, 1272, 0, 1, '2014-08-05 02:00:09', 0, '0000-00-00 00:00:00'),
(147, 102, 1, 1, 7, 500, 15, 7500, 0, 0, 0, 7500, 0, 1, '2014-08-05 02:00:22', 0, '0000-00-00 00:00:00'),
(148, 102, 4, 2, 1, 10, 120, 1200, 1, 0, 72, 1272, 0, 1, '2014-08-05 02:00:22', 0, '0000-00-00 00:00:00'),
(149, 103, 1, 1, 7, 500, 15, 7500, 0, 0, 0, 7500, 0, 1, '2014-08-05 02:00:25', 0, '0000-00-00 00:00:00'),
(150, 103, 4, 2, 1, 10, 120, 1200, 1, 0, 72, 1272, 0, 1, '2014-08-05 02:00:25', 0, '0000-00-00 00:00:00'),
(151, 104, 1, 1, 7, 500, 15, 7500, 0, 0, 0, 7500, 0, 1, '2014-08-05 02:00:36', 0, '0000-00-00 00:00:00'),
(152, 104, 4, 2, 1, 10, 120, 1200, 1, 0, 72, 1272, 0, 1, '2014-08-05 02:00:36', 0, '0000-00-00 00:00:00'),
(153, 105, 1, 1, 7, 500, 15, 7500, 0, 0, 0, 7500, 0, 1, '2014-08-05 02:00:38', 0, '0000-00-00 00:00:00'),
(154, 105, 4, 2, 1, 10, 120, 1200, 1, 0, 72, 1272, 0, 1, '2014-08-05 02:00:38', 0, '0000-00-00 00:00:00'),
(155, 106, 1, 1, 7, 500, 15, 7500, 0, 0, 0, 7500, 0, 1, '2014-08-05 02:00:41', 0, '0000-00-00 00:00:00'),
(156, 106, 4, 2, 1, 10, 120, 1200, 1, 0, 72, 1272, 0, 1, '2014-08-05 02:00:41', 0, '0000-00-00 00:00:00'),
(157, 107, 1, 1, 7, 500, 15, 7500, 0, 0, 0, 7500, 0, 1, '2014-08-05 02:00:46', 0, '0000-00-00 00:00:00'),
(158, 107, 4, 2, 1, 10, 120, 1200, 1, 0, 72, 1272, 0, 1, '2014-08-05 02:00:46', 0, '0000-00-00 00:00:00'),
(159, 108, 1, 1, 7, 500, 15, 7500, 0, 0, 0, 7500, 0, 1, '2014-08-05 02:00:49', 0, '0000-00-00 00:00:00'),
(160, 108, 4, 2, 1, 10, 120, 1200, 1, 0, 72, 1272, 0, 1, '2014-08-05 02:00:49', 0, '0000-00-00 00:00:00'),
(161, 109, 1, 1, 7, 500, 15, 7500, 0, 0, 0, 7500, 0, 1, '2014-08-05 02:00:58', 0, '0000-00-00 00:00:00'),
(162, 109, 4, 2, 1, 10, 120, 1200, 1, 0, 72, 1272, 0, 1, '2014-08-05 02:00:58', 0, '0000-00-00 00:00:00'),
(163, 110, 3, 1, 1, 23, 120, 2760, 1, 0, 165.6, 2925.6, 0, 16, '2014-08-05 02:14:55', 0, '0000-00-00 00:00:00'),
(164, 111, 3, 1, 1, 23, 120, 2760, 1, 0, 165.6, 2925.6, 0, 16, '2014-08-05 02:15:08', 0, '0000-00-00 00:00:00'),
(165, 112, 3, 1, 1, 23, 120, 2760, 1, 0, 165.6, 2925.6, 0, 16, '2014-08-05 02:23:53', 0, '0000-00-00 00:00:00'),
(166, 113, 4, 1, 4, 2, 10, 20, 0, 0, 0, 20, 0, 1, '2014-08-05 02:30:00', 0, '0000-00-00 00:00:00'),
(167, 114, 0, 1, 1, 1, 321, 321, 1, 6, 19.26, 340.26, 0, 1, '2014-08-05 07:16:18', 0, '0000-00-00 00:00:00'),
(168, 115, 0, 1, 8, 5, 10, 50, 1, 6, 3, 53, 0, 16, '2014-08-11 06:59:13', 0, '0000-00-00 00:00:00'),
(169, 116, 0, 1, 1, 1, 321, 321, 1, 6, 19.26, 340.26, 0, 16, '2014-08-11 07:19:48', 0, '0000-00-00 00:00:00'),
(170, 117, 0, 1, 1, 1, 321, 321, 1, 6, 19.26, 340.26, 0, 1, '2014-08-11 07:22:32', 0, '0000-00-00 00:00:00'),
(171, 118, 0, 1, 1, 1, 321, 321, 1, 6, 19.26, 340.26, 0, 1, '2014-08-11 07:29:04', 0, '0000-00-00 00:00:00'),
(172, 119, 0, 1, 1, 1, 321, 321, 1, 6, 19.26, 340.26, 0, 1, '2014-08-11 07:32:40', 0, '0000-00-00 00:00:00'),
(173, 120, 0, 1, 1, 1, 321, 321, 1, 6, 19.26, 340.26, 0, 1, '2014-08-11 07:37:04', 0, '0000-00-00 00:00:00'),
(174, 121, 0, 1, 4, 1, 1, 1, 0, 0, 0, 1, 0, 1, '2014-08-11 07:38:29', 0, '0000-00-00 00:00:00'),
(175, 122, 0, 1, 1, 1, 321, 321, 1, 6, 19.26, 340.26, 0, 1, '2014-08-11 07:41:12', 0, '0000-00-00 00:00:00'),
(176, 124, 0, 1, 4, 1, 1, 1, 0, 0, 0, 1, 0, 1, '2014-08-11 07:47:27', 0, '0000-00-00 00:00:00'),
(177, 125, 2, 1, 1, 12, 30, 360, 1, 0, 21.6, 381.6, 0, 1, '2014-08-11 07:49:46', 0, '0000-00-00 00:00:00'),
(178, 126, 0, 1, 11, 1, 20, 20, 35, 6, 1.2, 21.2, 0, 16, '2014-08-15 09:03:57', 16, '0000-00-00 00:00:00'),
(179, 129, 2, 1, 8, 10, 122, 1220, 10, 0, 73.2, 1293.2, 0, 1, '2014-08-11 08:17:09', 0, '0000-00-00 00:00:00'),
(180, 139, 4, 1, 1, 10, 120, 1200, 1, 0, 72, 1272, 0, 33, '2014-08-12 07:58:47', 0, '0000-00-00 00:00:00'),
(181, 140, 4, 1, 1, 10, 120, 1200, 1, 0, 72, 1272, 0, 33, '2014-08-12 08:02:32', 0, '0000-00-00 00:00:00'),
(182, 141, 0, 1, 1, 15, 321, 4815, 1, 6, 288.9, 5103.9, 0, 33, '2014-08-13 10:47:43', 0, '0000-00-00 00:00:00'),
(183, 145, 0, 1, 1, 1, 10, 10, 1, 6, 0.6, 10.6, 0, 1, '2014-08-15 06:44:39', 0, '0000-00-00 00:00:00'),
(184, 145, 0, 2, 8, 1, 10, 10, 2, 5, 0.5, 10.5, 0, 1, '2014-08-15 06:45:19', 0, '0000-00-00 00:00:00'),
(185, 146, 0, 1, 11, 10, 24, 240, 35, 6, 14.4, 254.4, 0, 33, '2014-08-15 09:46:33', 0, '0000-00-00 00:00:00');

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

--
-- Table structure for table `comp_sales_order`
--

CREATE TABLE IF NOT EXISTS `comp_sales_order` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `serialNo` int(16) NOT NULL,
  `companyID` int(11) NOT NULL,
  `invoiceID` int(11) NOT NULL,
  `customerID` int(11) DEFAULT NULL,
  `OrderNo` varchar(32) DEFAULT NULL,
  `formNo` varchar(32) DEFAULT NULL,
  `currencyID` int(11) DEFAULT NULL,
  `exchangeRate` double DEFAULT '1',
  `salesOrderDate` date DEFAULT NULL,
  `dateRequired` date DEFAULT NULL,
  `deliveryToID` int(11) DEFAULT NULL,
  `salesPerson` int(11) DEFAULT NULL,
  `memo` varchar(128) DEFAULT NULL,
  `supplierID` int(11) DEFAULT NULL,
  `totalAmount` double DEFAULT NULL,
  `totalReceivable` double DEFAULT NULL,
  `status` tinyint(1) DEFAULT '1',
  `createdBy` int(11) NOT NULL,
  `createdTS` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `updatedBy` int(11) NOT NULL,
  `updatedTS` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `is_delete` smallint(16) NOT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=10 ;

--
-- Dumping data for table `comp_sales_order`
--

INSERT INTO `comp_sales_order` (`ID`, `serialNo`, `companyID`, `invoiceID`, `customerID`, `OrderNo`, `formNo`, `currencyID`, `exchangeRate`, `salesOrderDate`, `dateRequired`, `deliveryToID`, `salesPerson`, `memo`, `supplierID`, `totalAmount`, `totalReceivable`, `status`, `createdBy`, `createdTS`, `updatedBy`, `updatedTS`, `is_delete`) VALUES
(1, 0, 1, 0, 12, 'SON20140718', NULL, 1, 1, '2014-06-11', NULL, 8, 6, 'test memo', NULL, 29400, NULL, 1, 1, '2014-07-18 07:16:58', 1, '0000-00-00 00:00:00', 0),
(2, 0, 1, 0, 15, 'SON20140718', NULL, 2, 1, '2014-06-18', NULL, 7, 0, '', NULL, 542540, NULL, 1, 1, '2014-07-18 07:16:58', 1, '0000-00-00 00:00:00', 0),
(3, 0, 1, 0, 12, 'SON20140718', NULL, 1, 1, '2014-06-18', NULL, 7, 0, '', NULL, 530200, NULL, 1, 1, '2014-07-18 07:16:58', 1, '0000-00-00 00:00:00', 0),
(4, 0, 1, 0, 16, 'SON20140718', NULL, 1, 1, '2014-06-18', NULL, 0, 0, '', NULL, 1000000, NULL, 1, 1, '2014-07-18 07:16:58', 0, '0000-00-00 00:00:00', 0),
(5, 0, 1, 0, 20, 'SON20140718', NULL, 1, 1, '2014-06-18', NULL, 0, 0, '', NULL, 35000, NULL, 1, 1, '2014-07-18 07:16:58', 0, '0000-00-00 00:00:00', 0),
(6, 0, 15, 0, 17, 'SON20140718', NULL, 1, 1, '2014-07-17', NULL, 6, 9, '', NULL, 250, NULL, 1, 16, '2014-07-18 07:16:58', 0, '0000-00-00 00:00:00', 0),
(7, 0, 1, 0, 12, 'SON20140718', NULL, 1, 1, '2014-07-18', NULL, 7, 0, '', NULL, 69, NULL, 1, 16, '2014-07-18 07:16:58', 0, '0000-00-00 00:00:00', 0),
(8, 0, 1, 0, 12, 'SON20140718', NULL, 1, 1, '2014-07-18', NULL, 7, 6, '', NULL, 584, NULL, 1, 16, '2014-07-18 07:16:58', 16, '0000-00-00 00:00:00', 0),
(9, 1, 81, 0, 34, 'SON', NULL, 1, 1, '2014-08-05', NULL, 0, 22, '', NULL, 170, NULL, 1, 29, '2014-08-05 01:25:19', 0, '0000-00-00 00:00:00', 0);

--
-- Triggers `comp_sales_order`
--
DROP TRIGGER IF EXISTS `trigger_before_insert_sor_add_serialNo`;
DELIMITER //
CREATE TRIGGER `trigger_before_insert_sor_add_serialNo` BEFORE INSERT ON `comp_sales_order`
 FOR EACH ROW set new.serialNo = (select nextSerialNo 
			   from view_serial_comp_sales_order
			   where companyID = new.companyID)
//
DELIMITER ;

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

--
-- Table structure for table `comp_sales_price`
--

CREATE TABLE IF NOT EXISTS `comp_sales_price` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `companyID` int(11) NOT NULL,
  `customerID` int(11) NOT NULL,
  `itemID` int(11) NOT NULL,
  `currencyID` int(11) NOT NULL,
  `umID` int(11) NOT NULL,
  `startDate` date NOT NULL,
  `endDate` date NOT NULL,
  `price` double NOT NULL,
  `updatedBy` int(11) NOT NULL,
  `createdBy` int(11) NOT NULL,
  `createdTS` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updatedTS` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=14 ;

--
-- Dumping data for table `comp_sales_price`
--

INSERT INTO `comp_sales_price` (`ID`, `companyID`, `customerID`, `itemID`, `currencyID`, `umID`, `startDate`, `endDate`, `price`, `updatedBy`, `createdBy`, `createdTS`, `updatedTS`) VALUES
(1, 1, 12, 1, 1, 2, '2014-06-05', '2014-12-31', 121, 16, 1, '2014-06-05 08:56:27', '2014-07-21 03:28:39'),
(2, 1, 15, 4, 2, 2, '2014-06-05', '2014-10-21', 50, 1, 1, '2014-06-05 08:59:21', '2014-06-05 09:48:21'),
(3, 1, 15, 8, 2, 2, '2014-06-05', '2014-06-24', 122, 0, 1, '2014-06-05 09:14:48', '2014-06-05 09:14:48'),
(4, 1, 15, 1, 2, 2, '2014-07-21', '2014-07-21', 345.44, 0, 16, '2014-07-21 03:38:48', '2014-07-21 03:38:48'),
(5, 1, 15, 1, 2, 2, '2014-07-21', '2014-07-21', 3345, 0, 16, '2014-07-21 03:47:42', '2014-07-21 03:47:42'),
(6, 1, 15, 1, 0, 2, '2014-07-21', '2014-07-21', 245234, 0, 16, '2014-07-21 04:03:07', '2014-07-21 04:03:07'),
(7, 1, 12, 13, 0, 2, '2014-07-21', '2014-07-21', 1111, 0, 16, '2014-07-21 04:03:44', '2014-07-21 04:03:44'),
(9, 1, 12, 1, 0, 2, '2014-07-21', '2014-07-21', 54321, 0, 16, '2014-07-21 04:15:45', '2014-07-21 04:15:45'),
(10, 1, 12, 1, 0, 13, '2014-07-21', '2014-07-30', 1234567, 0, 16, '2014-07-21 04:16:46', '2014-07-21 04:16:46'),
(11, 1, 16, 1, 1, 8, '2014-07-21', '2014-07-31', 543210, 0, 16, '2014-07-21 04:22:00', '2014-07-21 04:22:00'),
(12, 1, 12, 1, 1, 13, '2014-07-24', '2014-07-24', 234234, 0, 16, '2014-07-24 03:51:20', '2014-07-24 03:51:20'),
(13, 1, 15, 4, 2, 12, '2014-07-24', '2014-07-24', 3456, 0, 16, '2014-07-24 03:53:18', '2014-07-24 03:53:18');

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

--
-- Table structure for table `comp_so_seq`
--

CREATE TABLE IF NOT EXISTS `comp_so_seq` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `compID` int(11) DEFAULT NULL,
  `moduleID` int(11) DEFAULT NULL,
  `initial` varchar(2) CHARACTER SET utf8 DEFAULT NULL,
  `year` year(4) DEFAULT NULL,
  `period` int(2) DEFAULT NULL,
  `seqNo` int(11) NOT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `comp_supplier_closing`
--

CREATE TABLE IF NOT EXISTS `comp_supplier_closing` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `companyID` int(11) NOT NULL,
  `supplierID` int(11) NOT NULL,
  `yearMonth` varchar(6) NOT NULL,
  `openBalance` double NOT NULL,
  `totalDr` double NOT NULL,
  `totalCr` double NOT NULL,
  `balance` double NOT NULL,
  PRIMARY KEY (`ID`),
  KEY `companyID` (`companyID`,`supplierID`,`yearMonth`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=16 ;

--
-- Dumping data for table `comp_supplier_closing`
--

INSERT INTO `comp_supplier_closing` (`ID`, `companyID`, `supplierID`, `yearMonth`, `openBalance`, `totalDr`, `totalCr`, `balance`) VALUES
(1, 1, 1, '201406', 0, 30763, 62639, -93402),
(2, 1, 20, '201406', 0, 0, 2429, -2429),
(3, 1, 23, '201406', 0, 0, 144, -144),
(4, 1, 1, '201407', 0, 0, 0, 0),
(5, 1, 20, '201407', 0, 0, 0, 0),
(6, 1, 23, '201407', 0, 0, 0, 0),
(7, 1, 24, '201407', 0, 0, 0, 0),
(8, 27, 25, '201407', 0, 0, 0, 0),
(9, 15, 26, '201407', 0, 685.7, 0, -685.7),
(10, 15, 27, '201407', 0, 0, 0, 0),
(11, 15, 28, '201407', 0, 0, 0, 0),
(12, 45, 29, '201407', 0, 0, 0, 0),
(13, 57, 30, '201407', 0, 0, 0, 0),
(14, 1, 31, '201407', 0, 0, 0, 0),
(15, 81, 32, '201407', 0, 0, 0, 0);

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

--
-- Table structure for table `comp_supplier_closing_daily`
--

CREATE TABLE IF NOT EXISTS `comp_supplier_closing_daily` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `companyID` int(11) NOT NULL,
  `supplierID` int(11) NOT NULL,
  `transDate` date NOT NULL,
  `openBalance` double NOT NULL,
  `totalDr` double NOT NULL,
  `totalCr` double NOT NULL,
  `balance` double NOT NULL,
  `createdTS` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=795 ;

--
-- Dumping data for table `comp_supplier_closing_daily`
--

INSERT INTO `comp_supplier_closing_daily` (`ID`, `companyID`, `supplierID`, `transDate`, `openBalance`, `totalDr`, `totalCr`, `balance`, `createdTS`) VALUES
(1, 1, 1, '2014-06-11', 0, 0, 0, 0, '2014-06-30 00:33:48'),
(2, 1, 1, '2014-06-11', 0, 0, 0, 0, '2014-06-30 00:33:48'),
(3, 1, 20, '2014-06-12', 0, 0, 0, 0, '2014-06-30 00:33:48'),
(4, 1, 1, '2014-06-16', 0, 0, 0, 0, '2014-06-30 00:33:48'),
(5, 1, 20, '2014-06-16', 0, 0, 0, 0, '2014-06-30 00:33:48'),
(6, 1, 1, '2014-06-19', 0, 0, 0, 0, '2014-06-30 00:33:48'),
(7, 0, 1, '0000-00-00', 0, 0, 0, 0, '2014-06-30 04:35:12'),
(8, 0, 20, '0000-00-00', 0, 0, 0, 0, '2014-06-30 04:35:12'),
(9, 0, 23, '0000-00-00', 0, 0, 0, 0, '2014-06-30 04:35:12'),
(10, 0, 24, '0000-00-00', 0, 0, 0, 0, '2014-06-30 04:35:12'),
(11, 0, 25, '0000-00-00', 0, 0, 0, 0, '2014-06-30 04:35:12'),
(12, 0, 26, '0000-00-00', 0, 0, 0, 0, '2014-06-30 04:35:12'),
(13, 0, 27, '0000-00-00', 0, 0, 0, 0, '2014-06-30 04:35:12'),
(14, 0, 28, '0000-00-00', 0, 0, 0, 0, '2014-06-30 04:35:12'),
(22, 0, 1, '0000-00-00', 0, 0, 0, 0, '2014-06-30 04:35:16'),
(23, 0, 20, '0000-00-00', 0, 0, 0, 0, '2014-06-30 04:35:16'),
(24, 0, 23, '0000-00-00', 0, 0, 0, 0, '2014-06-30 04:35:16'),
(25, 0, 24, '0000-00-00', 0, 0, 0, 0, '2014-06-30 04:35:16'),
(26, 0, 25, '0000-00-00', 0, 0, 0, 0, '2014-06-30 04:35:16'),
(27, 0, 26, '0000-00-00', 0, 0, 0, 0, '2014-06-30 04:35:16'),
(28, 0, 27, '0000-00-00', 0, 0, 0, 0, '2014-06-30 04:35:16'),
(29, 0, 28, '0000-00-00', 0, 0, 0, 0, '2014-06-30 04:35:16'),
(37, 0, 1, '0000-00-00', 0, 0, 0, 0, '2014-06-30 16:00:00'),
(38, 0, 20, '0000-00-00', 0, 0, 0, 0, '2014-06-30 16:00:00'),
(39, 0, 23, '0000-00-00', 0, 0, 0, 0, '2014-06-30 16:00:00'),
(40, 0, 24, '0000-00-00', 0, 0, 0, 0, '2014-06-30 16:00:00'),
(41, 0, 25, '0000-00-00', 0, 0, 0, 0, '2014-06-30 16:00:00'),
(42, 0, 26, '0000-00-00', 0, 0, 0, 0, '2014-06-30 16:00:00'),
(43, 0, 27, '0000-00-00', 0, 0, 0, 0, '2014-06-30 16:00:00'),
(44, 0, 28, '0000-00-00', 0, 0, 0, 0, '2014-06-30 16:00:00'),
(52, 0, 1, '2014-07-02', 0, 0, 0, 0, '2014-07-01 16:00:00'),
(53, 0, 20, '2014-07-02', 0, 0, 0, 0, '2014-07-01 16:00:00'),
(54, 0, 23, '2014-07-02', 0, 0, 0, 0, '2014-07-01 16:00:00'),
(55, 0, 24, '2014-07-02', 0, 0, 0, 0, '2014-07-01 16:00:00'),
(56, 0, 25, '2014-07-02', 0, 0, 0, 0, '2014-07-01 16:00:00'),
(57, 0, 26, '2014-07-02', 0, 0, 0, 0, '2014-07-01 16:00:00'),
(58, 0, 27, '2014-07-02', 0, 0, 0, 0, '2014-07-01 16:00:00'),
(59, 0, 28, '2014-07-02', 0, 0, 0, 0, '2014-07-01 16:00:00'),
(67, 1, 1, '2014-07-03', 0, 0, 0, 0, '2014-07-02 16:00:00'),
(68, 1, 20, '2014-07-03', 0, 0, 0, 0, '2014-07-02 16:00:00'),
(69, 1, 23, '2014-07-03', 0, 0, 0, 0, '2014-07-02 16:00:00'),
(70, 1, 24, '2014-07-03', 0, 0, 0, 0, '2014-07-02 16:00:00'),
(71, 27, 25, '2014-07-03', 0, 0, 0, 0, '2014-07-02 16:00:00'),
(72, 15, 26, '2014-07-03', 0, 0, 0, 0, '2014-07-02 16:00:00'),
(73, 15, 27, '2014-07-03', 0, 0, 0, 0, '2014-07-02 16:00:00'),
(74, 15, 28, '2014-07-03', 0, 0, 0, 0, '2014-07-02 16:00:00'),
(82, 1, 1, '2014-07-04', 0, 0, 0, 0, '2014-07-03 16:00:18'),
(83, 1, 20, '2014-07-04', 0, 0, 0, 0, '2014-07-03 16:00:18'),
(84, 1, 23, '2014-07-04', 0, 0, 0, 0, '2014-07-03 16:00:18'),
(85, 1, 24, '2014-07-04', 0, 0, 0, 0, '2014-07-03 16:00:18'),
(86, 27, 25, '2014-07-04', 0, 0, 0, 0, '2014-07-03 16:00:18'),
(87, 15, 26, '2014-07-04', 0, 0, 0, 0, '2014-07-03 16:00:18'),
(88, 15, 27, '2014-07-04', 0, 0, 0, 0, '2014-07-03 16:00:18'),
(89, 15, 28, '2014-07-04', 0, 0, 0, 0, '2014-07-03 16:00:18'),
(90, 45, 29, '2014-07-04', 0, 0, 0, 0, '2014-07-03 16:00:18'),
(97, 1, 1, '2014-07-05', 0, 0, 0, 0, '2014-07-04 16:00:05'),
(98, 1, 20, '2014-07-05', 0, 0, 0, 0, '2014-07-04 16:00:05'),
(99, 1, 23, '2014-07-05', 0, 0, 0, 0, '2014-07-04 16:00:05'),
(100, 1, 24, '2014-07-05', 0, 0, 0, 0, '2014-07-04 16:00:05'),
(101, 27, 25, '2014-07-05', 0, 0, 0, 0, '2014-07-04 16:00:05'),
(102, 15, 26, '2014-07-05', 0, 0, 0, 0, '2014-07-04 16:00:05'),
(103, 15, 27, '2014-07-05', 0, 0, 0, 0, '2014-07-04 16:00:05'),
(104, 15, 28, '2014-07-05', 0, 0, 0, 0, '2014-07-04 16:00:05'),
(105, 45, 29, '2014-07-05', 0, 0, 0, 0, '2014-07-04 16:00:05'),
(112, 1, 1, '2014-07-06', 0, 0, 0, 0, '2014-07-05 16:00:00'),
(113, 1, 20, '2014-07-06', 0, 0, 0, 0, '2014-07-05 16:00:00'),
(114, 1, 23, '2014-07-06', 0, 0, 0, 0, '2014-07-05 16:00:00'),
(115, 1, 24, '2014-07-06', 0, 0, 0, 0, '2014-07-05 16:00:00'),
(116, 27, 25, '2014-07-06', 0, 0, 0, 0, '2014-07-05 16:00:00'),
(117, 15, 26, '2014-07-06', 0, 0, 0, 0, '2014-07-05 16:00:00'),
(118, 15, 27, '2014-07-06', 0, 0, 0, 0, '2014-07-05 16:00:00'),
(119, 15, 28, '2014-07-06', 0, 0, 0, 0, '2014-07-05 16:00:00'),
(120, 45, 29, '2014-07-06', 0, 0, 0, 0, '2014-07-05 16:00:00'),
(127, 1, 1, '2014-07-07', 0, 0, 0, 0, '2014-07-06 16:00:00'),
(128, 1, 20, '2014-07-07', 0, 0, 0, 0, '2014-07-06 16:00:00'),
(129, 1, 23, '2014-07-07', 0, 0, 0, 0, '2014-07-06 16:00:00'),
(130, 1, 24, '2014-07-07', 0, 0, 0, 0, '2014-07-06 16:00:00'),
(131, 27, 25, '2014-07-07', 0, 0, 0, 0, '2014-07-06 16:00:00'),
(132, 15, 26, '2014-07-07', 0, 0, 0, 0, '2014-07-06 16:00:00'),
(133, 15, 27, '2014-07-07', 0, 0, 0, 0, '2014-07-06 16:00:00'),
(134, 15, 28, '2014-07-07', 0, 0, 0, 0, '2014-07-06 16:00:00'),
(135, 45, 29, '2014-07-07', 0, 0, 0, 0, '2014-07-06 16:00:00'),
(142, 1, 1, '2014-07-08', 0, 0, 0, 0, '2014-07-07 16:00:00'),
(143, 1, 20, '2014-07-08', 0, 0, 0, 0, '2014-07-07 16:00:00'),
(144, 1, 23, '2014-07-08', 0, 0, 0, 0, '2014-07-07 16:00:00'),
(145, 1, 24, '2014-07-08', 0, 0, 0, 0, '2014-07-07 16:00:00'),
(146, 27, 25, '2014-07-08', 0, 0, 0, 0, '2014-07-07 16:00:00'),
(147, 15, 26, '2014-07-08', 0, 0, 0, 0, '2014-07-07 16:00:00'),
(148, 15, 27, '2014-07-08', 0, 0, 0, 0, '2014-07-07 16:00:00'),
(149, 15, 28, '2014-07-08', 0, 0, 0, 0, '2014-07-07 16:00:00'),
(150, 45, 29, '2014-07-08', 0, 0, 0, 0, '2014-07-07 16:00:00'),
(157, 1, 1, '2014-07-09', 0, 0, 0, 0, '2014-07-08 16:00:00'),
(158, 1, 20, '2014-07-09', 0, 0, 0, 0, '2014-07-08 16:00:00'),
(159, 1, 23, '2014-07-09', 0, 0, 0, 0, '2014-07-08 16:00:00'),
(160, 1, 24, '2014-07-09', 0, 0, 0, 0, '2014-07-08 16:00:00'),
(161, 27, 25, '2014-07-09', 0, 0, 0, 0, '2014-07-08 16:00:00'),
(162, 15, 26, '2014-07-09', 0, 0, 0, 0, '2014-07-08 16:00:00'),
(163, 15, 27, '2014-07-09', 0, 0, 0, 0, '2014-07-08 16:00:00'),
(164, 15, 28, '2014-07-09', 0, 0, 0, 0, '2014-07-08 16:00:00'),
(165, 45, 29, '2014-07-09', 0, 0, 0, 0, '2014-07-08 16:00:00'),
(172, 1, 1, '2014-07-10', 0, 0, 0, 0, '2014-07-09 16:00:00'),
(173, 1, 20, '2014-07-10', 0, 0, 0, 0, '2014-07-09 16:00:00'),
(174, 1, 23, '2014-07-10', 0, 0, 0, 0, '2014-07-09 16:00:00'),
(175, 1, 24, '2014-07-10', 0, 0, 0, 0, '2014-07-09 16:00:00'),
(176, 27, 25, '2014-07-10', 0, 0, 0, 0, '2014-07-09 16:00:00'),
(177, 15, 26, '2014-07-10', 0, 0, 0, 0, '2014-07-09 16:00:00'),
(178, 15, 27, '2014-07-10', 0, 0, 0, 0, '2014-07-09 16:00:00'),
(179, 15, 28, '2014-07-10', 0, 0, 0, 0, '2014-07-09 16:00:00'),
(180, 45, 29, '2014-07-10', 0, 0, 0, 0, '2014-07-09 16:00:00'),
(181, 57, 30, '2014-07-10', 0, 0, 0, 0, '2014-07-09 16:00:00'),
(182, 1, 31, '2014-07-10', 0, 0, 0, 0, '2014-07-09 16:00:00'),
(187, 1, 1, '2014-07-11', 0, 0, 0, 0, '2014-07-10 16:00:28'),
(188, 1, 20, '2014-07-11', 0, 0, 0, 0, '2014-07-10 16:00:28'),
(189, 1, 23, '2014-07-11', 0, 0, 0, 0, '2014-07-10 16:00:28'),
(190, 1, 24, '2014-07-11', 0, 0, 0, 0, '2014-07-10 16:00:28'),
(191, 27, 25, '2014-07-11', 0, 0, 0, 0, '2014-07-10 16:00:28'),
(192, 15, 26, '2014-07-11', 0, 0, 0, 0, '2014-07-10 16:00:28'),
(193, 15, 27, '2014-07-11', 0, 0, 0, 0, '2014-07-10 16:00:28'),
(194, 15, 28, '2014-07-11', 0, 0, 0, 0, '2014-07-10 16:00:28'),
(195, 45, 29, '2014-07-11', 0, 0, 0, 0, '2014-07-10 16:00:28'),
(196, 57, 30, '2014-07-11', 0, 0, 0, 0, '2014-07-10 16:00:28'),
(197, 1, 31, '2014-07-11', 0, 0, 0, 0, '2014-07-10 16:00:28'),
(202, 1, 1, '2014-07-12', 0, 0, 0, 0, '2014-07-11 16:00:04'),
(203, 1, 20, '2014-07-12', 0, 0, 0, 0, '2014-07-11 16:00:04'),
(204, 1, 23, '2014-07-12', 0, 0, 0, 0, '2014-07-11 16:00:04'),
(205, 1, 24, '2014-07-12', 0, 0, 0, 0, '2014-07-11 16:00:04'),
(206, 27, 25, '2014-07-12', 0, 0, 0, 0, '2014-07-11 16:00:04'),
(207, 15, 26, '2014-07-12', 0, 0, 0, 0, '2014-07-11 16:00:04'),
(208, 15, 27, '2014-07-12', 0, 0, 0, 0, '2014-07-11 16:00:04'),
(209, 15, 28, '2014-07-12', 0, 0, 0, 0, '2014-07-11 16:00:04'),
(210, 45, 29, '2014-07-12', 0, 0, 0, 0, '2014-07-11 16:00:04'),
(211, 57, 30, '2014-07-12', 0, 0, 0, 0, '2014-07-11 16:00:04'),
(212, 1, 31, '2014-07-12', 0, 0, 0, 0, '2014-07-11 16:00:04'),
(217, 1, 1, '2014-07-13', 0, 0, 0, 0, '2014-07-12 16:00:00'),
(218, 1, 20, '2014-07-13', 0, 0, 0, 0, '2014-07-12 16:00:00'),
(219, 1, 23, '2014-07-13', 0, 0, 0, 0, '2014-07-12 16:00:00'),
(220, 1, 24, '2014-07-13', 0, 0, 0, 0, '2014-07-12 16:00:00'),
(221, 27, 25, '2014-07-13', 0, 0, 0, 0, '2014-07-12 16:00:00'),
(222, 15, 26, '2014-07-13', 0, 0, 0, 0, '2014-07-12 16:00:00'),
(223, 15, 27, '2014-07-13', 0, 0, 0, 0, '2014-07-12 16:00:00'),
(224, 15, 28, '2014-07-13', 0, 0, 0, 0, '2014-07-12 16:00:00'),
(225, 45, 29, '2014-07-13', 0, 0, 0, 0, '2014-07-12 16:00:00'),
(226, 57, 30, '2014-07-13', 0, 0, 0, 0, '2014-07-12 16:00:00'),
(227, 1, 31, '2014-07-13', 0, 0, 0, 0, '2014-07-12 16:00:00'),
(232, 1, 1, '2014-07-14', 0, 0, 0, 0, '2014-07-13 16:00:00'),
(233, 1, 20, '2014-07-14', 0, 0, 0, 0, '2014-07-13 16:00:00'),
(234, 1, 23, '2014-07-14', 0, 0, 0, 0, '2014-07-13 16:00:00'),
(235, 1, 24, '2014-07-14', 0, 0, 0, 0, '2014-07-13 16:00:00'),
(236, 27, 25, '2014-07-14', 0, 0, 0, 0, '2014-07-13 16:00:00'),
(237, 15, 26, '2014-07-14', 0, 0, 0, 0, '2014-07-13 16:00:00'),
(238, 15, 27, '2014-07-14', 0, 0, 0, 0, '2014-07-13 16:00:00'),
(239, 15, 28, '2014-07-14', 0, 0, 0, 0, '2014-07-13 16:00:00'),
(240, 45, 29, '2014-07-14', 0, 0, 0, 0, '2014-07-13 16:00:00'),
(241, 57, 30, '2014-07-14', 0, 0, 0, 0, '2014-07-13 16:00:00'),
(242, 1, 31, '2014-07-14', 0, 0, 0, 0, '2014-07-13 16:00:00'),
(247, 1, 1, '2014-07-15', 0, 0, 0, 0, '2014-07-14 16:00:00'),
(248, 1, 20, '2014-07-15', 0, 0, 0, 0, '2014-07-14 16:00:00'),
(249, 1, 23, '2014-07-15', 0, 0, 0, 0, '2014-07-14 16:00:00'),
(250, 1, 24, '2014-07-15', 0, 0, 0, 0, '2014-07-14 16:00:00'),
(251, 27, 25, '2014-07-15', 0, 0, 0, 0, '2014-07-14 16:00:00'),
(252, 15, 26, '2014-07-15', 0, 0, 0, 0, '2014-07-14 16:00:00'),
(253, 15, 27, '2014-07-15', 0, 0, 0, 0, '2014-07-14 16:00:00'),
(254, 15, 28, '2014-07-15', 0, 0, 0, 0, '2014-07-14 16:00:00'),
(255, 45, 29, '2014-07-15', 0, 0, 0, 0, '2014-07-14 16:00:00'),
(256, 57, 30, '2014-07-15', 0, 0, 0, 0, '2014-07-14 16:00:00'),
(257, 1, 31, '2014-07-15', 0, 0, 0, 0, '2014-07-14 16:00:00'),
(262, 1, 1, '2014-07-16', 0, 0, 0, 0, '2014-07-15 16:00:00'),
(263, 1, 20, '2014-07-16', 0, 0, 0, 0, '2014-07-15 16:00:00'),
(264, 1, 23, '2014-07-16', 0, 0, 0, 0, '2014-07-15 16:00:00'),
(265, 1, 24, '2014-07-16', 0, 0, 0, 0, '2014-07-15 16:00:00'),
(266, 27, 25, '2014-07-16', 0, 0, 0, 0, '2014-07-15 16:00:00'),
(267, 15, 26, '2014-07-16', 0, 0, 0, 0, '2014-07-15 16:00:00'),
(268, 15, 27, '2014-07-16', 0, 0, 0, 0, '2014-07-15 16:00:00'),
(269, 15, 28, '2014-07-16', 0, 0, 0, 0, '2014-07-15 16:00:00'),
(270, 45, 29, '2014-07-16', 0, 0, 0, 0, '2014-07-15 16:00:00'),
(271, 57, 30, '2014-07-16', 0, 0, 0, 0, '2014-07-15 16:00:00'),
(272, 1, 31, '2014-07-16', 0, 0, 0, 0, '2014-07-15 16:00:00'),
(277, 1, 1, '2014-07-17', 0, 0, 0, 0, '2014-07-16 16:00:00'),
(278, 1, 20, '2014-07-17', 0, 0, 0, 0, '2014-07-16 16:00:00'),
(279, 1, 23, '2014-07-17', 0, 0, 0, 0, '2014-07-16 16:00:00'),
(280, 1, 24, '2014-07-17', 0, 0, 0, 0, '2014-07-16 16:00:00'),
(281, 27, 25, '2014-07-17', 0, 0, 0, 0, '2014-07-16 16:00:00'),
(282, 15, 26, '2014-07-17', 0, 0, 0, 0, '2014-07-16 16:00:00'),
(283, 15, 27, '2014-07-17', 0, 0, 0, 0, '2014-07-16 16:00:00'),
(284, 15, 28, '2014-07-17', 0, 0, 0, 0, '2014-07-16 16:00:00'),
(285, 45, 29, '2014-07-17', 0, 0, 0, 0, '2014-07-16 16:00:00'),
(286, 57, 30, '2014-07-17', 0, 0, 0, 0, '2014-07-16 16:00:00'),
(287, 1, 31, '2014-07-17', 0, 0, 0, 0, '2014-07-16 16:00:00'),
(292, 1, 1, '2014-07-18', 0, 0, 0, 0, '2014-07-17 16:00:30'),
(293, 1, 20, '2014-07-18', 0, 0, 0, 0, '2014-07-17 16:00:30'),
(294, 1, 23, '2014-07-18', 0, 0, 0, 0, '2014-07-17 16:00:30'),
(295, 1, 24, '2014-07-18', 0, 0, 0, 0, '2014-07-17 16:00:30'),
(296, 27, 25, '2014-07-18', 0, 0, 0, 0, '2014-07-17 16:00:30'),
(297, 15, 26, '2014-07-18', 0, 0, 0, 0, '2014-07-17 16:00:30'),
(298, 15, 27, '2014-07-18', 0, 0, 0, 0, '2014-07-17 16:00:30'),
(299, 15, 28, '2014-07-18', 0, 0, 0, 0, '2014-07-17 16:00:30'),
(300, 45, 29, '2014-07-18', 0, 0, 0, 0, '2014-07-17 16:00:30'),
(301, 57, 30, '2014-07-18', 0, 0, 0, 0, '2014-07-17 16:00:30'),
(302, 1, 31, '2014-07-18', 0, 0, 0, 0, '2014-07-17 16:00:30'),
(307, 1, 1, '2014-07-19', 0, 0, 0, 0, '2014-07-18 16:00:03'),
(308, 1, 20, '2014-07-19', 0, 0, 0, 0, '2014-07-18 16:00:03'),
(309, 1, 23, '2014-07-19', 0, 0, 0, 0, '2014-07-18 16:00:03'),
(310, 1, 24, '2014-07-19', 0, 0, 0, 0, '2014-07-18 16:00:03'),
(311, 27, 25, '2014-07-19', 0, 0, 0, 0, '2014-07-18 16:00:03'),
(312, 15, 26, '2014-07-19', 0, 0, 0, 0, '2014-07-18 16:00:03'),
(313, 15, 27, '2014-07-19', 0, 0, 0, 0, '2014-07-18 16:00:03'),
(314, 15, 28, '2014-07-19', 0, 0, 0, 0, '2014-07-18 16:00:03'),
(315, 45, 29, '2014-07-19', 0, 0, 0, 0, '2014-07-18 16:00:03'),
(316, 57, 30, '2014-07-19', 0, 0, 0, 0, '2014-07-18 16:00:03'),
(317, 1, 31, '2014-07-19', 0, 0, 0, 0, '2014-07-18 16:00:03'),
(322, 1, 1, '2014-07-20', 0, 0, 0, 0, '2014-07-19 16:00:00'),
(323, 1, 20, '2014-07-20', 0, 0, 0, 0, '2014-07-19 16:00:00'),
(324, 1, 23, '2014-07-20', 0, 0, 0, 0, '2014-07-19 16:00:00'),
(325, 1, 24, '2014-07-20', 0, 0, 0, 0, '2014-07-19 16:00:00'),
(326, 27, 25, '2014-07-20', 0, 0, 0, 0, '2014-07-19 16:00:00'),
(327, 15, 26, '2014-07-20', 0, 0, 0, 0, '2014-07-19 16:00:00'),
(328, 15, 27, '2014-07-20', 0, 0, 0, 0, '2014-07-19 16:00:00'),
(329, 15, 28, '2014-07-20', 0, 0, 0, 0, '2014-07-19 16:00:00'),
(330, 45, 29, '2014-07-20', 0, 0, 0, 0, '2014-07-19 16:00:00'),
(331, 57, 30, '2014-07-20', 0, 0, 0, 0, '2014-07-19 16:00:00'),
(332, 1, 31, '2014-07-20', 0, 0, 0, 0, '2014-07-19 16:00:00'),
(337, 1, 1, '2014-07-21', 0, 0, 0, 0, '2014-07-20 16:00:00'),
(338, 1, 20, '2014-07-21', 0, 0, 0, 0, '2014-07-20 16:00:00'),
(339, 1, 23, '2014-07-21', 0, 0, 0, 0, '2014-07-20 16:00:00'),
(340, 1, 24, '2014-07-21', 0, 0, 0, 0, '2014-07-20 16:00:00'),
(341, 27, 25, '2014-07-21', 0, 0, 0, 0, '2014-07-20 16:00:00'),
(342, 15, 26, '2014-07-21', 0, 0, 0, 0, '2014-07-20 16:00:00'),
(343, 15, 27, '2014-07-21', 0, 0, 0, 0, '2014-07-20 16:00:00'),
(344, 15, 28, '2014-07-21', 0, 0, 0, 0, '2014-07-20 16:00:00'),
(345, 45, 29, '2014-07-21', 0, 0, 0, 0, '2014-07-20 16:00:00'),
(346, 57, 30, '2014-07-21', 0, 0, 0, 0, '2014-07-20 16:00:00'),
(347, 1, 31, '2014-07-21', 0, 0, 0, 0, '2014-07-20 16:00:00'),
(352, 1, 1, '2014-07-22', 0, 0, 0, 0, '2014-07-21 16:00:00'),
(353, 1, 20, '2014-07-22', 0, 0, 0, 0, '2014-07-21 16:00:00'),
(354, 1, 23, '2014-07-22', 0, 0, 0, 0, '2014-07-21 16:00:00'),
(355, 1, 24, '2014-07-22', 0, 0, 0, 0, '2014-07-21 16:00:00'),
(356, 27, 25, '2014-07-22', 0, 0, 0, 0, '2014-07-21 16:00:00'),
(357, 15, 26, '2014-07-22', 0, 0, 0, 0, '2014-07-21 16:00:00'),
(358, 15, 27, '2014-07-22', 0, 0, 0, 0, '2014-07-21 16:00:00'),
(359, 15, 28, '2014-07-22', 0, 0, 0, 0, '2014-07-21 16:00:00'),
(360, 45, 29, '2014-07-22', 0, 0, 0, 0, '2014-07-21 16:00:00'),
(361, 57, 30, '2014-07-22', 0, 0, 0, 0, '2014-07-21 16:00:00'),
(362, 1, 31, '2014-07-22', 0, 0, 0, 0, '2014-07-21 16:00:00'),
(363, 81, 32, '2014-07-22', 0, 0, 0, 0, '2014-07-21 16:00:00'),
(367, 1, 1, '2014-07-23', 0, 0, 0, 0, '2014-07-22 16:00:00'),
(368, 1, 20, '2014-07-23', 0, 0, 0, 0, '2014-07-22 16:00:00'),
(369, 1, 23, '2014-07-23', 0, 0, 0, 0, '2014-07-22 16:00:00'),
(370, 1, 24, '2014-07-23', 0, 0, 0, 0, '2014-07-22 16:00:00'),
(371, 27, 25, '2014-07-23', 0, 0, 0, 0, '2014-07-22 16:00:00'),
(372, 15, 26, '2014-07-23', 0, 0, 0, 0, '2014-07-22 16:00:00'),
(373, 15, 27, '2014-07-23', 0, 0, 0, 0, '2014-07-22 16:00:00'),
(374, 15, 28, '2014-07-23', 0, 0, 0, 0, '2014-07-22 16:00:00'),
(375, 45, 29, '2014-07-23', 0, 0, 0, 0, '2014-07-22 16:00:00'),
(376, 57, 30, '2014-07-23', 0, 0, 0, 0, '2014-07-22 16:00:00'),
(377, 1, 31, '2014-07-23', 0, 0, 0, 0, '2014-07-22 16:00:00'),
(378, 81, 32, '2014-07-23', 0, 0, 0, 0, '2014-07-22 16:00:00'),
(382, 1, 1, '2014-07-24', 0, 0, 0, 0, '2014-07-23 16:00:00'),
(383, 1, 20, '2014-07-24', 0, 0, 0, 0, '2014-07-23 16:00:00'),
(384, 1, 23, '2014-07-24', 0, 0, 0, 0, '2014-07-23 16:00:00'),
(385, 1, 24, '2014-07-24', 0, 0, 0, 0, '2014-07-23 16:00:00'),
(386, 27, 25, '2014-07-24', 0, 0, 0, 0, '2014-07-23 16:00:00'),
(387, 15, 26, '2014-07-24', 0, 0, 0, 0, '2014-07-23 16:00:00'),
(388, 15, 27, '2014-07-24', 0, 0, 0, 0, '2014-07-23 16:00:00'),
(389, 15, 28, '2014-07-24', 0, 0, 0, 0, '2014-07-23 16:00:00'),
(390, 45, 29, '2014-07-24', 0, 0, 0, 0, '2014-07-23 16:00:00'),
(391, 57, 30, '2014-07-24', 0, 0, 0, 0, '2014-07-23 16:00:00'),
(392, 1, 31, '2014-07-24', 0, 0, 0, 0, '2014-07-23 16:00:00'),
(393, 81, 32, '2014-07-24', 0, 0, 0, 0, '2014-07-23 16:00:00'),
(397, 1, 1, '2014-07-25', 0, 0, 0, 0, '2014-07-24 16:00:27'),
(398, 1, 20, '2014-07-25', 0, 0, 0, 0, '2014-07-24 16:00:27'),
(399, 1, 23, '2014-07-25', 0, 0, 0, 0, '2014-07-24 16:00:27'),
(400, 1, 24, '2014-07-25', 0, 0, 0, 0, '2014-07-24 16:00:27'),
(401, 27, 25, '2014-07-25', 0, 0, 0, 0, '2014-07-24 16:00:27'),
(402, 15, 26, '2014-07-25', 0, 0, 0, 0, '2014-07-24 16:00:27'),
(403, 15, 27, '2014-07-25', 0, 0, 0, 0, '2014-07-24 16:00:27'),
(404, 15, 28, '2014-07-25', 0, 0, 0, 0, '2014-07-24 16:00:27'),
(405, 45, 29, '2014-07-25', 0, 0, 0, 0, '2014-07-24 16:00:27'),
(406, 57, 30, '2014-07-25', 0, 0, 0, 0, '2014-07-24 16:00:27'),
(407, 1, 31, '2014-07-25', 0, 0, 0, 0, '2014-07-24 16:00:27'),
(408, 81, 32, '2014-07-25', 0, 0, 0, 0, '2014-07-24 16:00:27'),
(412, 1, 1, '2014-07-26', 0, 0, 0, 0, '2014-07-25 16:00:00'),
(413, 1, 20, '2014-07-26', 0, 0, 0, 0, '2014-07-25 16:00:00'),
(414, 1, 23, '2014-07-26', 0, 0, 0, 0, '2014-07-25 16:00:00'),
(415, 1, 24, '2014-07-26', 0, 0, 0, 0, '2014-07-25 16:00:00'),
(416, 27, 25, '2014-07-26', 0, 0, 0, 0, '2014-07-25 16:00:00'),
(417, 15, 26, '2014-07-26', 0, 0, 0, 0, '2014-07-25 16:00:00'),
(418, 15, 27, '2014-07-26', 0, 0, 0, 0, '2014-07-25 16:00:00'),
(419, 15, 28, '2014-07-26', 0, 0, 0, 0, '2014-07-25 16:00:00'),
(420, 45, 29, '2014-07-26', 0, 0, 0, 0, '2014-07-25 16:00:00'),
(421, 57, 30, '2014-07-26', 0, 0, 0, 0, '2014-07-25 16:00:00'),
(422, 1, 31, '2014-07-26', 0, 0, 0, 0, '2014-07-25 16:00:00'),
(423, 81, 32, '2014-07-26', 0, 0, 0, 0, '2014-07-25 16:00:00'),
(427, 1, 1, '2014-07-27', 0, 0, 0, 0, '2014-07-26 16:00:00'),
(428, 1, 20, '2014-07-27', 0, 0, 0, 0, '2014-07-26 16:00:00'),
(429, 1, 23, '2014-07-27', 0, 0, 0, 0, '2014-07-26 16:00:00'),
(430, 1, 24, '2014-07-27', 0, 0, 0, 0, '2014-07-26 16:00:00'),
(431, 27, 25, '2014-07-27', 0, 0, 0, 0, '2014-07-26 16:00:00'),
(432, 15, 26, '2014-07-27', 0, 0, 0, 0, '2014-07-26 16:00:00'),
(433, 15, 27, '2014-07-27', 0, 0, 0, 0, '2014-07-26 16:00:00'),
(434, 15, 28, '2014-07-27', 0, 0, 0, 0, '2014-07-26 16:00:00'),
(435, 45, 29, '2014-07-27', 0, 0, 0, 0, '2014-07-26 16:00:00'),
(436, 57, 30, '2014-07-27', 0, 0, 0, 0, '2014-07-26 16:00:00'),
(437, 1, 31, '2014-07-27', 0, 0, 0, 0, '2014-07-26 16:00:00'),
(438, 81, 32, '2014-07-27', 0, 0, 0, 0, '2014-07-26 16:00:00'),
(442, 1, 1, '2014-07-28', 0, 0, 0, 0, '2014-07-27 16:00:00'),
(443, 1, 20, '2014-07-28', 0, 0, 0, 0, '2014-07-27 16:00:00'),
(444, 1, 23, '2014-07-28', 0, 0, 0, 0, '2014-07-27 16:00:00'),
(445, 1, 24, '2014-07-28', 0, 0, 0, 0, '2014-07-27 16:00:00'),
(446, 27, 25, '2014-07-28', 0, 0, 0, 0, '2014-07-27 16:00:00'),
(447, 15, 26, '2014-07-28', 0, 0, 0, 0, '2014-07-27 16:00:00'),
(448, 15, 27, '2014-07-28', 0, 0, 0, 0, '2014-07-27 16:00:00'),
(449, 15, 28, '2014-07-28', 0, 0, 0, 0, '2014-07-27 16:00:00'),
(450, 45, 29, '2014-07-28', 0, 0, 0, 0, '2014-07-27 16:00:00'),
(451, 57, 30, '2014-07-28', 0, 0, 0, 0, '2014-07-27 16:00:00'),
(452, 1, 31, '2014-07-28', 0, 0, 0, 0, '2014-07-27 16:00:00'),
(453, 81, 32, '2014-07-28', 0, 0, 0, 0, '2014-07-27 16:00:00'),
(457, 1, 1, '2014-07-29', 0, 0, 0, 0, '2014-07-28 16:00:00'),
(458, 1, 20, '2014-07-29', 0, 0, 0, 0, '2014-07-28 16:00:00'),
(459, 1, 23, '2014-07-29', 0, 0, 0, 0, '2014-07-28 16:00:00'),
(460, 1, 24, '2014-07-29', 0, 0, 0, 0, '2014-07-28 16:00:00'),
(461, 27, 25, '2014-07-29', 0, 0, 0, 0, '2014-07-28 16:00:00'),
(462, 15, 26, '2014-07-29', 0, 0, 0, 0, '2014-07-28 16:00:00'),
(463, 15, 27, '2014-07-29', 0, 0, 0, 0, '2014-07-28 16:00:00'),
(464, 15, 28, '2014-07-29', 0, 0, 0, 0, '2014-07-28 16:00:00'),
(465, 45, 29, '2014-07-29', 0, 0, 0, 0, '2014-07-28 16:00:00'),
(466, 57, 30, '2014-07-29', 0, 0, 0, 0, '2014-07-28 16:00:00'),
(467, 1, 31, '2014-07-29', 0, 0, 0, 0, '2014-07-28 16:00:00'),
(468, 81, 32, '2014-07-29', 0, 0, 0, 0, '2014-07-28 16:00:00'),
(472, 1, 1, '2014-07-30', 0, 0, 0, 0, '2014-07-29 16:00:00'),
(473, 1, 20, '2014-07-30', 0, 0, 0, 0, '2014-07-29 16:00:00'),
(474, 1, 23, '2014-07-30', 0, 0, 0, 0, '2014-07-29 16:00:00'),
(475, 1, 24, '2014-07-30', 0, 0, 0, 0, '2014-07-29 16:00:00'),
(476, 27, 25, '2014-07-30', 0, 0, 0, 0, '2014-07-29 16:00:00'),
(477, 15, 26, '2014-07-30', 0, 0, 0, 0, '2014-07-29 16:00:00'),
(478, 15, 27, '2014-07-30', 0, 0, 0, 0, '2014-07-29 16:00:00'),
(479, 15, 28, '2014-07-30', 0, 0, 0, 0, '2014-07-29 16:00:00'),
(480, 45, 29, '2014-07-30', 0, 0, 0, 0, '2014-07-29 16:00:00'),
(481, 57, 30, '2014-07-30', 0, 0, 0, 0, '2014-07-29 16:00:00'),
(482, 1, 31, '2014-07-30', 0, 0, 0, 0, '2014-07-29 16:00:00'),
(483, 81, 32, '2014-07-30', 0, 0, 0, 0, '2014-07-29 16:00:00'),
(487, 1, 1, '2014-07-31', 0, 0, 0, 0, '2014-07-30 16:00:00'),
(488, 1, 20, '2014-07-31', 0, 0, 0, 0, '2014-07-30 16:00:00'),
(489, 1, 23, '2014-07-31', 0, 0, 0, 0, '2014-07-30 16:00:00'),
(490, 1, 24, '2014-07-31', 0, 0, 0, 0, '2014-07-30 16:00:00'),
(491, 27, 25, '2014-07-31', 0, 0, 0, 0, '2014-07-30 16:00:00'),
(492, 15, 26, '2014-07-31', 0, 0, 0, 0, '2014-07-30 16:00:00'),
(493, 15, 27, '2014-07-31', 0, 0, 0, 0, '2014-07-30 16:00:00'),
(494, 15, 28, '2014-07-31', 0, 0, 0, 0, '2014-07-30 16:00:00'),
(495, 45, 29, '2014-07-31', 0, 0, 0, 0, '2014-07-30 16:00:00'),
(496, 57, 30, '2014-07-31', 0, 0, 0, 0, '2014-07-30 16:00:00'),
(497, 1, 31, '2014-07-31', 0, 0, 0, 0, '2014-07-30 16:00:00'),
(498, 81, 32, '2014-07-31', 0, 0, 0, 0, '2014-07-30 16:00:00'),
(502, 1, 1, '2014-08-01', 0, 0, 0, 0, '2014-07-31 16:00:28'),
(503, 1, 20, '2014-08-01', 0, 0, 0, 0, '2014-07-31 16:00:28'),
(504, 1, 23, '2014-08-01', 0, 0, 0, 0, '2014-07-31 16:00:28'),
(505, 1, 24, '2014-08-01', 0, 0, 0, 0, '2014-07-31 16:00:28'),
(506, 27, 25, '2014-08-01', 0, 0, 0, 0, '2014-07-31 16:00:28'),
(507, 15, 26, '2014-08-01', 0, 0, 0, 0, '2014-07-31 16:00:28'),
(508, 15, 27, '2014-08-01', 0, 0, 0, 0, '2014-07-31 16:00:28'),
(509, 15, 28, '2014-08-01', 0, 0, 0, 0, '2014-07-31 16:00:28'),
(510, 45, 29, '2014-08-01', 0, 0, 0, 0, '2014-07-31 16:00:28'),
(511, 57, 30, '2014-08-01', 0, 0, 0, 0, '2014-07-31 16:00:28'),
(512, 1, 31, '2014-08-01', 0, 0, 0, 0, '2014-07-31 16:00:28'),
(513, 81, 32, '2014-08-01', 0, 0, 0, 0, '2014-07-31 16:00:28'),
(517, 1, 1, '2014-08-02', 0, 0, 0, 0, '2014-08-01 16:00:05'),
(518, 1, 20, '2014-08-02', 0, 0, 0, 0, '2014-08-01 16:00:05'),
(519, 1, 23, '2014-08-02', 0, 0, 0, 0, '2014-08-01 16:00:05'),
(520, 1, 24, '2014-08-02', 0, 0, 0, 0, '2014-08-01 16:00:05'),
(521, 27, 25, '2014-08-02', 0, 0, 0, 0, '2014-08-01 16:00:05'),
(522, 15, 26, '2014-08-02', 0, 0, 0, 0, '2014-08-01 16:00:05'),
(523, 15, 27, '2014-08-02', 0, 0, 0, 0, '2014-08-01 16:00:05'),
(524, 15, 28, '2014-08-02', 0, 0, 0, 0, '2014-08-01 16:00:05'),
(525, 45, 29, '2014-08-02', 0, 0, 0, 0, '2014-08-01 16:00:05'),
(526, 57, 30, '2014-08-02', 0, 0, 0, 0, '2014-08-01 16:00:05'),
(527, 1, 31, '2014-08-02', 0, 0, 0, 0, '2014-08-01 16:00:05'),
(528, 81, 32, '2014-08-02', 0, 0, 0, 0, '2014-08-01 16:00:05'),
(532, 1, 1, '2014-08-03', 0, 0, 0, 0, '2014-08-02 16:00:00'),
(533, 1, 20, '2014-08-03', 0, 0, 0, 0, '2014-08-02 16:00:00'),
(534, 1, 23, '2014-08-03', 0, 0, 0, 0, '2014-08-02 16:00:00'),
(535, 1, 24, '2014-08-03', 0, 0, 0, 0, '2014-08-02 16:00:00'),
(536, 27, 25, '2014-08-03', 0, 0, 0, 0, '2014-08-02 16:00:00'),
(537, 15, 26, '2014-08-03', 0, 0, 0, 0, '2014-08-02 16:00:00'),
(538, 15, 27, '2014-08-03', 0, 0, 0, 0, '2014-08-02 16:00:00'),
(539, 15, 28, '2014-08-03', 0, 0, 0, 0, '2014-08-02 16:00:00'),
(540, 45, 29, '2014-08-03', 0, 0, 0, 0, '2014-08-02 16:00:00'),
(541, 57, 30, '2014-08-03', 0, 0, 0, 0, '2014-08-02 16:00:00'),
(542, 1, 31, '2014-08-03', 0, 0, 0, 0, '2014-08-02 16:00:00'),
(543, 81, 32, '2014-08-03', 0, 0, 0, 0, '2014-08-02 16:00:00'),
(547, 1, 1, '2014-08-04', 0, 0, 0, 0, '2014-08-03 16:00:00'),
(548, 1, 20, '2014-08-04', 0, 0, 0, 0, '2014-08-03 16:00:00'),
(549, 1, 23, '2014-08-04', 0, 0, 0, 0, '2014-08-03 16:00:00'),
(550, 1, 24, '2014-08-04', 0, 0, 0, 0, '2014-08-03 16:00:00'),
(551, 27, 25, '2014-08-04', 0, 0, 0, 0, '2014-08-03 16:00:00'),
(552, 15, 26, '2014-08-04', 0, 0, 0, 0, '2014-08-03 16:00:00'),
(553, 15, 27, '2014-08-04', 0, 0, 0, 0, '2014-08-03 16:00:00'),
(554, 15, 28, '2014-08-04', 0, 0, 0, 0, '2014-08-03 16:00:00'),
(555, 45, 29, '2014-08-04', 0, 0, 0, 0, '2014-08-03 16:00:00'),
(556, 57, 30, '2014-08-04', 0, 0, 0, 0, '2014-08-03 16:00:00'),
(557, 1, 31, '2014-08-04', 0, 0, 0, 0, '2014-08-03 16:00:00'),
(558, 81, 32, '2014-08-04', 0, 0, 0, 0, '2014-08-03 16:00:00'),
(562, 1, 1, '2014-08-05', 0, 0, 0, 0, '2014-08-04 16:00:00'),
(563, 1, 20, '2014-08-05', 0, 0, 0, 0, '2014-08-04 16:00:00'),
(564, 1, 23, '2014-08-05', 0, 0, 0, 0, '2014-08-04 16:00:00'),
(565, 1, 24, '2014-08-05', 0, 0, 0, 0, '2014-08-04 16:00:00'),
(566, 27, 25, '2014-08-05', 0, 0, 0, 0, '2014-08-04 16:00:00'),
(567, 15, 26, '2014-08-05', 0, 0, 0, 0, '2014-08-04 16:00:00'),
(568, 15, 27, '2014-08-05', 0, 0, 0, 0, '2014-08-04 16:00:00'),
(569, 15, 28, '2014-08-05', 0, 0, 0, 0, '2014-08-04 16:00:00'),
(570, 45, 29, '2014-08-05', 0, 0, 0, 0, '2014-08-04 16:00:00'),
(571, 57, 30, '2014-08-05', 0, 0, 0, 0, '2014-08-04 16:00:00'),
(572, 1, 31, '2014-08-05', 0, 0, 0, 0, '2014-08-04 16:00:00'),
(573, 81, 32, '2014-08-05', 0, 0, 0, 0, '2014-08-04 16:00:00'),
(574, 81, 33, '2014-08-05', 0, 0, 0, 0, '2014-08-04 16:00:00'),
(577, 1, 1, '2014-08-06', 0, 0, 0, 0, '2014-08-05 16:00:00'),
(578, 1, 20, '2014-08-06', 0, 0, 0, 0, '2014-08-05 16:00:00'),
(579, 1, 23, '2014-08-06', 0, 0, 0, 0, '2014-08-05 16:00:00'),
(580, 1, 24, '2014-08-06', 0, 0, 0, 0, '2014-08-05 16:00:00'),
(581, 27, 25, '2014-08-06', 0, 0, 0, 0, '2014-08-05 16:00:00'),
(582, 15, 26, '2014-08-06', 0, 0, 0, 0, '2014-08-05 16:00:00'),
(583, 15, 27, '2014-08-06', 0, 0, 0, 0, '2014-08-05 16:00:00'),
(584, 15, 28, '2014-08-06', 0, 0, 0, 0, '2014-08-05 16:00:00'),
(585, 45, 29, '2014-08-06', 0, 0, 0, 0, '2014-08-05 16:00:00'),
(586, 57, 30, '2014-08-06', 0, 0, 0, 0, '2014-08-05 16:00:00'),
(587, 1, 31, '2014-08-06', 0, 0, 0, 0, '2014-08-05 16:00:00'),
(588, 81, 32, '2014-08-06', 0, 0, 0, 0, '2014-08-05 16:00:00'),
(589, 81, 33, '2014-08-06', 0, 0, 0, 0, '2014-08-05 16:00:00'),
(590, 84, 34, '2014-08-06', 0, 0, 0, 0, '2014-08-05 16:00:00'),
(592, 1, 1, '2014-08-07', 0, 0, 0, 0, '2014-08-06 16:00:00'),
(593, 1, 20, '2014-08-07', 0, 0, 0, 0, '2014-08-06 16:00:00'),
(594, 1, 23, '2014-08-07', 0, 0, 0, 0, '2014-08-06 16:00:00'),
(595, 1, 24, '2014-08-07', 0, 0, 0, 0, '2014-08-06 16:00:00'),
(596, 27, 25, '2014-08-07', 0, 0, 0, 0, '2014-08-06 16:00:00'),
(597, 15, 26, '2014-08-07', 0, 0, 0, 0, '2014-08-06 16:00:00'),
(598, 15, 27, '2014-08-07', 0, 0, 0, 0, '2014-08-06 16:00:00'),
(599, 15, 28, '2014-08-07', 0, 0, 0, 0, '2014-08-06 16:00:00'),
(600, 45, 29, '2014-08-07', 0, 0, 0, 0, '2014-08-06 16:00:00'),
(601, 57, 30, '2014-08-07', 0, 0, 0, 0, '2014-08-06 16:00:00'),
(602, 1, 31, '2014-08-07', 0, 0, 0, 0, '2014-08-06 16:00:00'),
(603, 81, 32, '2014-08-07', 0, 0, 0, 0, '2014-08-06 16:00:00'),
(604, 81, 33, '2014-08-07', 0, 0, 0, 0, '2014-08-06 16:00:00'),
(605, 84, 34, '2014-08-07', 0, 0, 0, 0, '2014-08-06 16:00:00'),
(607, 1, 1, '2014-08-08', 0, 0, 0, 0, '2014-08-07 16:00:28'),
(608, 1, 20, '2014-08-08', 0, 0, 0, 0, '2014-08-07 16:00:28'),
(609, 1, 23, '2014-08-08', 0, 0, 0, 0, '2014-08-07 16:00:28'),
(610, 1, 24, '2014-08-08', 0, 0, 0, 0, '2014-08-07 16:00:28'),
(611, 27, 25, '2014-08-08', 0, 0, 0, 0, '2014-08-07 16:00:28'),
(612, 15, 26, '2014-08-08', 0, 0, 0, 0, '2014-08-07 16:00:28'),
(613, 15, 27, '2014-08-08', 0, 0, 0, 0, '2014-08-07 16:00:28'),
(614, 15, 28, '2014-08-08', 0, 0, 0, 0, '2014-08-07 16:00:28'),
(615, 45, 29, '2014-08-08', 0, 0, 0, 0, '2014-08-07 16:00:28'),
(616, 57, 30, '2014-08-08', 0, 0, 0, 0, '2014-08-07 16:00:28'),
(617, 1, 31, '2014-08-08', 0, 0, 0, 0, '2014-08-07 16:00:28'),
(618, 81, 32, '2014-08-08', 0, 0, 0, 0, '2014-08-07 16:00:28'),
(619, 81, 33, '2014-08-08', 0, 0, 0, 0, '2014-08-07 16:00:28'),
(620, 84, 34, '2014-08-08', 0, 0, 0, 0, '2014-08-07 16:00:28'),
(622, 1, 1, '2014-08-09', 0, 0, 0, 0, '2014-08-08 16:00:04'),
(623, 1, 20, '2014-08-09', 0, 0, 0, 0, '2014-08-08 16:00:04'),
(624, 1, 23, '2014-08-09', 0, 0, 0, 0, '2014-08-08 16:00:04'),
(625, 1, 24, '2014-08-09', 0, 0, 0, 0, '2014-08-08 16:00:04'),
(626, 27, 25, '2014-08-09', 0, 0, 0, 0, '2014-08-08 16:00:04'),
(627, 15, 26, '2014-08-09', 0, 0, 0, 0, '2014-08-08 16:00:04'),
(628, 15, 27, '2014-08-09', 0, 0, 0, 0, '2014-08-08 16:00:04'),
(629, 15, 28, '2014-08-09', 0, 0, 0, 0, '2014-08-08 16:00:04'),
(630, 45, 29, '2014-08-09', 0, 0, 0, 0, '2014-08-08 16:00:04'),
(631, 57, 30, '2014-08-09', 0, 0, 0, 0, '2014-08-08 16:00:04'),
(632, 1, 31, '2014-08-09', 0, 0, 0, 0, '2014-08-08 16:00:04'),
(633, 81, 32, '2014-08-09', 0, 0, 0, 0, '2014-08-08 16:00:04'),
(634, 81, 33, '2014-08-09', 0, 0, 0, 0, '2014-08-08 16:00:04'),
(635, 84, 34, '2014-08-09', 0, 0, 0, 0, '2014-08-08 16:00:04'),
(636, 82, 35, '2014-08-09', 0, 0, 0, 0, '2014-08-08 16:00:04'),
(637, 82, 36, '2014-08-09', 0, 0, 0, 0, '2014-08-08 16:00:04'),
(653, 1, 1, '2014-08-10', 0, 0, 0, 0, '2014-08-09 16:00:00'),
(654, 1, 20, '2014-08-10', 0, 0, 0, 0, '2014-08-09 16:00:00'),
(655, 1, 23, '2014-08-10', 0, 0, 0, 0, '2014-08-09 16:00:00'),
(656, 1, 24, '2014-08-10', 0, 0, 0, 0, '2014-08-09 16:00:00'),
(657, 27, 25, '2014-08-10', 0, 0, 0, 0, '2014-08-09 16:00:00'),
(658, 15, 26, '2014-08-10', 0, 0, 0, 0, '2014-08-09 16:00:00'),
(659, 15, 27, '2014-08-10', 0, 0, 0, 0, '2014-08-09 16:00:00'),
(660, 15, 28, '2014-08-10', 0, 0, 0, 0, '2014-08-09 16:00:00'),
(661, 45, 29, '2014-08-10', 0, 0, 0, 0, '2014-08-09 16:00:00'),
(662, 57, 30, '2014-08-10', 0, 0, 0, 0, '2014-08-09 16:00:00'),
(663, 1, 31, '2014-08-10', 0, 0, 0, 0, '2014-08-09 16:00:00'),
(664, 81, 32, '2014-08-10', 0, 0, 0, 0, '2014-08-09 16:00:00'),
(665, 81, 33, '2014-08-10', 0, 0, 0, 0, '2014-08-09 16:00:00'),
(666, 84, 34, '2014-08-10', 0, 0, 0, 0, '2014-08-09 16:00:00'),
(667, 82, 35, '2014-08-10', 0, 0, 0, 0, '2014-08-09 16:00:00'),
(668, 82, 36, '2014-08-10', 0, 0, 0, 0, '2014-08-09 16:00:00'),
(684, 1, 1, '2014-08-11', 0, 0, 0, 0, '2014-08-10 16:00:00'),
(685, 1, 20, '2014-08-11', 0, 0, 0, 0, '2014-08-10 16:00:00'),
(686, 1, 23, '2014-08-11', 0, 0, 0, 0, '2014-08-10 16:00:00'),
(687, 1, 24, '2014-08-11', 0, 0, 0, 0, '2014-08-10 16:00:00'),
(688, 27, 25, '2014-08-11', 0, 0, 0, 0, '2014-08-10 16:00:00'),
(689, 15, 26, '2014-08-11', 0, 0, 0, 0, '2014-08-10 16:00:00'),
(690, 15, 27, '2014-08-11', 0, 0, 0, 0, '2014-08-10 16:00:00'),
(691, 15, 28, '2014-08-11', 0, 0, 0, 0, '2014-08-10 16:00:00'),
(692, 45, 29, '2014-08-11', 0, 0, 0, 0, '2014-08-10 16:00:00'),
(693, 57, 30, '2014-08-11', 0, 0, 0, 0, '2014-08-10 16:00:00'),
(694, 1, 31, '2014-08-11', 0, 0, 0, 0, '2014-08-10 16:00:00'),
(695, 81, 32, '2014-08-11', 0, 0, 0, 0, '2014-08-10 16:00:00'),
(696, 81, 33, '2014-08-11', 0, 0, 0, 0, '2014-08-10 16:00:00'),
(697, 84, 34, '2014-08-11', 0, 0, 0, 0, '2014-08-10 16:00:00'),
(698, 82, 35, '2014-08-11', 0, 0, 0, 0, '2014-08-10 16:00:00'),
(699, 82, 36, '2014-08-11', 0, 0, 0, 0, '2014-08-10 16:00:00'),
(715, 1, 1, '2014-08-12', 0, 0, 0, 0, '2014-08-11 16:00:00'),
(716, 1, 20, '2014-08-12', 0, 0, 0, 0, '2014-08-11 16:00:00'),
(717, 1, 23, '2014-08-12', 0, 0, 0, 0, '2014-08-11 16:00:00'),
(718, 1, 24, '2014-08-12', 0, 0, 0, 0, '2014-08-11 16:00:00'),
(719, 27, 25, '2014-08-12', 0, 0, 0, 0, '2014-08-11 16:00:00'),
(720, 15, 26, '2014-08-12', 0, 0, 0, 0, '2014-08-11 16:00:00'),
(721, 15, 27, '2014-08-12', 0, 0, 0, 0, '2014-08-11 16:00:00'),
(722, 15, 28, '2014-08-12', 0, 0, 0, 0, '2014-08-11 16:00:00'),
(723, 45, 29, '2014-08-12', 0, 0, 0, 0, '2014-08-11 16:00:00'),
(724, 57, 30, '2014-08-12', 0, 0, 0, 0, '2014-08-11 16:00:00'),
(725, 1, 31, '2014-08-12', 0, 0, 0, 0, '2014-08-11 16:00:00'),
(726, 81, 32, '2014-08-12', 0, 0, 0, 0, '2014-08-11 16:00:00'),
(727, 81, 33, '2014-08-12', 0, 0, 0, 0, '2014-08-11 16:00:00'),
(728, 84, 34, '2014-08-12', 0, 0, 0, 0, '2014-08-11 16:00:00'),
(729, 82, 35, '2014-08-12', 0, 0, 0, 0, '2014-08-11 16:00:00'),
(730, 82, 36, '2014-08-12', 0, 0, 0, 0, '2014-08-11 16:00:00'),
(746, 1, 1, '2014-08-13', 0, 0, 0, 0, '2014-08-12 16:00:00'),
(747, 1, 20, '2014-08-13', 0, 0, 0, 0, '2014-08-12 16:00:00'),
(748, 1, 23, '2014-08-13', 0, 0, 0, 0, '2014-08-12 16:00:00'),
(749, 1, 24, '2014-08-13', 0, 0, 0, 0, '2014-08-12 16:00:00'),
(750, 27, 25, '2014-08-13', 0, 0, 0, 0, '2014-08-12 16:00:00'),
(751, 15, 26, '2014-08-13', 0, 0, 0, 0, '2014-08-12 16:00:00'),
(752, 15, 27, '2014-08-13', 0, 0, 0, 0, '2014-08-12 16:00:00'),
(753, 15, 28, '2014-08-13', 0, 0, 0, 0, '2014-08-12 16:00:00'),
(754, 45, 29, '2014-08-13', 0, 0, 0, 0, '2014-08-12 16:00:00'),
(755, 57, 30, '2014-08-13', 0, 0, 0, 0, '2014-08-12 16:00:00'),
(756, 1, 31, '2014-08-13', 0, 0, 0, 0, '2014-08-12 16:00:00'),
(757, 81, 32, '2014-08-13', 0, 0, 0, 0, '2014-08-12 16:00:00'),
(758, 81, 33, '2014-08-13', 0, 0, 0, 0, '2014-08-12 16:00:00'),
(759, 84, 34, '2014-08-13', 0, 0, 0, 0, '2014-08-12 16:00:00'),
(760, 82, 35, '2014-08-13', 0, 0, 0, 0, '2014-08-12 16:00:00'),
(761, 82, 36, '2014-08-13', 0, 0, 0, 0, '2014-08-12 16:00:00'),
(777, 1, 1, '2014-08-14', 0, 0, 0, 0, '2014-08-13 16:00:00'),
(778, 1, 20, '2014-08-14', 0, 0, 0, 0, '2014-08-13 16:00:00'),
(779, 1, 23, '2014-08-14', 0, 0, 0, 0, '2014-08-13 16:00:00'),
(780, 1, 24, '2014-08-14', 0, 0, 0, 0, '2014-08-13 16:00:00'),
(781, 27, 25, '2014-08-14', 0, 0, 0, 0, '2014-08-13 16:00:00'),
(782, 15, 26, '2014-08-14', 0, 0, 0, 0, '2014-08-13 16:00:00'),
(783, 15, 27, '2014-08-14', 0, 0, 0, 0, '2014-08-13 16:00:00'),
(784, 15, 28, '2014-08-14', 0, 0, 0, 0, '2014-08-13 16:00:00'),
(785, 45, 29, '2014-08-14', 0, 0, 0, 0, '2014-08-13 16:00:00'),
(786, 57, 30, '2014-08-14', 0, 0, 0, 0, '2014-08-13 16:00:00'),
(787, 1, 31, '2014-08-14', 0, 0, 0, 0, '2014-08-13 16:00:00'),
(788, 81, 32, '2014-08-14', 0, 0, 0, 0, '2014-08-13 16:00:00'),
(789, 81, 33, '2014-08-14', 0, 0, 0, 0, '2014-08-13 16:00:00'),
(790, 84, 34, '2014-08-14', 0, 0, 0, 0, '2014-08-13 16:00:00'),
(791, 82, 35, '2014-08-14', 0, 0, 0, 0, '2014-08-13 16:00:00'),
(792, 82, 36, '2014-08-14', 0, 0, 0, 0, '2014-08-13 16:00:00'),
(793, 1, 37, '2014-08-14', 0, 0, 0, 0, '2014-08-13 16:00:00'),
(794, 1, 38, '2014-08-14', 0, 0, 0, 0, '2014-08-13 16:00:00');

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

--
-- Table structure for table `comp_supplier_creditnote`
--

CREATE TABLE IF NOT EXISTS `comp_supplier_creditnote` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `serialNo` int(11) NOT NULL DEFAULT '1',
  `companyID` int(11) NOT NULL,
  `supplierID` int(11) NOT NULL,
  `formNo` varchar(32) NOT NULL,
  `creditNoteDate` date NOT NULL,
  `supplierInvoiceID` int(11) NOT NULL,
  `projectID` int(11) NOT NULL,
  `termsID` int(11) NOT NULL,
  `currencyID` int(11) NOT NULL,
  `exchangeRate` double NOT NULL,
  `agentID` int(11) NOT NULL,
  `memo` text NOT NULL,
  `employeeID` int(11) NOT NULL,
  `shippingMethodID` int(11) NOT NULL,
  `totalAmount` double NOT NULL,
  `amountPaid` decimal(10,0) NOT NULL,
  `totalTaxAmount` double NOT NULL,
  `totalPayable` double NOT NULL,
  `total` 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` smallint(16) NOT NULL,
  `updateAble` tinyint(1) NOT NULL DEFAULT '1',
  `journalNo` varchar(32) NOT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=26 ;

--
-- Dumping data for table `comp_supplier_creditnote`
--

INSERT INTO `comp_supplier_creditnote` (`ID`, `serialNo`, `companyID`, `supplierID`, `formNo`, `creditNoteDate`, `supplierInvoiceID`, `projectID`, `termsID`, `currencyID`, `exchangeRate`, `agentID`, `memo`, `employeeID`, `shippingMethodID`, `totalAmount`, `amountPaid`, `totalTaxAmount`, `totalPayable`, `total`, `createdBy`, `createdTS`, `updatedBy`, `updatedTS`, `is_delete`, `updateAble`, `journalNo`) VALUES
(1, 1, 1, 20, 'PCN', '2014-06-16', 76, 15, 0, 1, 1, 0, '', 0, 0, 0, '0', 1, 0, 0, 1, '2014-06-16 01:54:00', 0, '2014-06-16 07:55:49', 0, 0, ''),
(2, 1, 1, 1, 'PCN', '2014-06-16', 77, 1, 0, 1, 1, 0, '', 0, 0, 12, '0', 0.72, 12.72, 0, 1, '2014-06-16 03:16:12', 0, '2014-06-23 08:49:57', 0, 0, ''),
(3, 1, 1, 1, 'PCN', '2014-06-16', 82, 10, 0, 1, 1, 0, '', 0, 0, 0, '0', 1, 0, 0, 1, '2014-06-16 03:17:20', 0, '2014-06-16 07:55:49', 0, 0, ''),
(4, 1, 1, 1, 'PCN', '2014-06-23', 71, 2, 0, 0, 1, 0, '', 0, 0, 0, '0', 0, 0, 0, 16, '2014-06-23 05:06:24', 0, '0000-00-00 00:00:00', 0, 1, ''),
(5, 1, 1, 1, 'PCN', '2014-06-23', 71, 15, 0, 0, 1, 0, 'asa', 0, 0, 0, '0', 0, 0, 0, 16, '2014-06-23 07:36:57', 0, '0000-00-00 00:00:00', 0, 1, ''),
(6, 1, 1, 1, 'PCN', '2014-06-23', 71, 1, 0, 0, 23, 0, '', 0, 0, 0, '0', 0, 0, 0, 16, '2014-06-23 07:51:34', 0, '0000-00-00 00:00:00', 0, 1, ''),
(7, 1, 1, 1, 'PCN', '2014-06-23', 71, 15, 0, 0, 1, 0, 'zdaq', 0, 0, 0, '0', 0, 0, 0, 16, '2014-06-23 08:00:38', 0, '0000-00-00 00:00:00', 0, 1, ''),
(8, 1, 1, 1, 'PCN', '2014-06-23', 71, 17, 0, 0, 1, 0, 'asa', 0, 0, 0, '0', 0, 0, 0, 16, '2014-06-23 08:02:28', 0, '0000-00-00 00:00:00', 0, 1, ''),
(9, 1, 1, 1, 'PCN', '2014-06-23', 71, 0, 0, 0, 0, 0, '', 0, 0, 0, '0', 0, 0, 0, 16, '2014-06-23 08:41:22', 0, '0000-00-00 00:00:00', 0, 1, ''),
(10, 1, 1, 1, 'PCN', '2014-06-23', 71, 0, 0, 0, 0, 0, 'asa as', 0, 0, 0, '0', 0, 0, 0, 16, '2014-06-23 08:46:39', 0, '0000-00-00 00:00:00', 0, 1, ''),
(11, 1, 1, 1, 'PCN', '2014-06-23', 71, 0, 0, 0, 0, 0, '', 0, 0, 0, '0', 0, 0, 0, 16, '2014-06-23 08:58:43', 0, '0000-00-00 00:00:00', 0, 1, ''),
(12, 1, 1, 1, 'PCN', '2014-06-23', 71, 0, 0, 0, 0, 0, '', 0, 0, 0, '0', 0, 0, 0, 16, '2014-06-23 09:03:08', 0, '0000-00-00 00:00:00', 0, 1, ''),
(13, 1, 1, 1, 'PCN', '2014-06-23', 71, 16, 0, 0, 1, 0, 'ASA', 0, 0, 2357, '0', 0.72, 2357.72, 0, 16, '2014-06-23 11:03:40', 0, '2014-06-23 11:04:08', 0, 1, ''),
(14, 1, 1, 1, 'PCN', '2014-06-23', 71, 2, 0, 0, 1, 0, 'QWEQ', 0, 0, 133, '0', 1.32, 134, 0, 16, '2014-06-23 11:15:20', 0, '2014-06-23 11:16:07', 0, 1, ''),
(15, 1, 1, 1, 'PCN', '2014-06-23', 71, 0, 0, 0, 0, 0, 'sds', 0, 0, 0, '0', 0, 0, 0, 16, '2014-06-23 11:24:43', 0, '0000-00-00 00:00:00', 0, 1, ''),
(16, 1, 1, 1, 'PCN', '2014-06-23', 71, 0, 0, 0, 0, 0, '', 0, 0, 0, '0', 0, 0, 0, 16, '2014-06-23 11:26:05', 0, '0000-00-00 00:00:00', 0, 1, ''),
(17, 1, 1, 1, 'PCN', '2014-06-23', 71, 0, 0, 0, 0, 0, 'da', 0, 0, 48, '0', 0.24, 48, 0, 16, '2014-06-23 11:28:30', 0, '2014-06-23 11:59:16', 0, 1, ''),
(18, 1, 1, 1, 'PCN', '2014-06-24', 73, 16, 0, 0, 12, 0, '', 0, 0, 28176, '0', 5910.84, 34087, 0, 16, '2014-06-24 01:18:33', 0, '2014-07-09 04:12:56', 0, 0, ''),
(19, 1, 1, 1, 'PCN', '2014-06-24', 72, 17, 0, 0, 1, 0, 'sds', 0, 0, 13, '0', 0.72, 13.72, 0, 16, '2014-06-24 01:26:34', 0, '2014-06-24 01:26:57', 0, 1, ''),
(20, 1, 1, 1, 'PCN', '2014-06-24', 72, 16, 0, 0, 1, 0, 'sds', 0, 0, 1268, '0', 366.96, 29734.96, 0, 16, '2014-06-24 01:28:45', 0, '2014-07-07 02:41:38', 0, 1, ''),
(21, 1, 1, 1, 'PCN', '2014-07-14', 71, 17, 0, 0, 1, 0, '', 0, 0, 0, '0', 0.06, 1.06, 0, 16, '2014-07-14 04:45:59', 0, '2014-07-14 04:45:59', 0, 1, ''),
(22, 1, 1, 1, 'PCN', '2014-07-14', 71, 15, 0, 0, 1, 0, '', 0, 0, 5.0600000000000005, '0', 0.06, 1.06, 0, 16, '2014-07-14 04:55:42', 0, '2014-07-14 04:56:38', 0, 1, ''),
(23, 1, 1, 1, 'PCN', '2014-07-14', 71, 17, 0, 0, 1, 0, 'sds', 0, 0, 1.06, '0', 0.06, 1.06, 0, 16, '2014-07-14 05:03:55', 0, '2014-07-14 05:03:55', 0, 1, ''),
(24, 1, 1, 1, 'PCN', '2014-07-14', 72, 1, 0, 0, 1, 0, '', 0, 0, 1.01, '0', 0.0006, 1, 0, 16, '2014-07-14 05:08:21', 0, '2014-07-14 05:08:53', 0, 1, ''),
(25, 1, 1, 1, 'PCN', '2014-07-14', 71, 1, 0, 0, 1, 0, 'juo', 0, 0, 23555555558.5, '0', 1333333333.4999998, 2.12, 0, 16, '2014-07-14 05:10:22', 0, '2014-07-14 06:04:58', 0, 1, '');

--
-- Triggers `comp_supplier_creditnote`
--
DROP TRIGGER IF EXISTS `trigger_before_insert_scno_add_serialNo`;
DELIMITER //
CREATE TRIGGER `trigger_before_insert_scno_add_serialNo` BEFORE INSERT ON `comp_supplier_creditnote`
 FOR EACH ROW set new.serialNo = (select nextSerialNo 
			   from view_serial_comp_supplier_creditnote
			   where companyID = new.companyID)
//
DELIMITER ;

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

--
-- Table structure for table `comp_supplier_creditnote_charges`
--

CREATE TABLE IF NOT EXISTS `comp_supplier_creditnote_charges` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `creditNoteID` int(11) NOT NULL,
  `lineNo` int(11) NOT NULL,
  `accountNoID` int(11) NOT NULL,
  `itemname` varchar(64) NOT NULL,
  `itemdescription` text NOT NULL,
  `quantity` int(11) NOT NULL,
  `unitPrice` double NOT NULL,
  `amountExcludedTax` double NOT NULL,
  `taxID` int(11) NOT NULL,
  `taxRate` double NOT NULL,
  `taxAmount` double NOT NULL,
  `amountIncludedTax` double NOT NULL,
  `drAccountID` int(11) NOT NULL,
  `crAccountID` int(11) NOT NULL,
  `drTaxAccountID` int(11) NOT NULL,
  `crTaxAccountID` 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 '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=34 ;

--
-- Dumping data for table `comp_supplier_creditnote_charges`
--

INSERT INTO `comp_supplier_creditnote_charges` (`ID`, `creditNoteID`, `lineNo`, `accountNoID`, `itemname`, `itemdescription`, `quantity`, `unitPrice`, `amountExcludedTax`, `taxID`, `taxRate`, `taxAmount`, `amountIncludedTax`, `drAccountID`, `crAccountID`, `drTaxAccountID`, `crTaxAccountID`, `createdBy`, `createdTS`, `updatedBy`, `updatedTS`) VALUES
(1, 9, 1, 100, '', 'sds', 0, 0, 12, 1, 0, 0.72, 12.72, 0, 0, 0, 0, 0, '2014-06-23 08:41:22', 0, '0000-00-00 00:00:00'),
(2, 10, 1, 102, '', 'asa', 0, 0, 12, 4, 0, 0, 12, 0, 0, 0, 0, 0, '2014-06-23 08:46:39', 0, '0000-00-00 00:00:00'),
(3, 2, 2, 98, '', 'qwwwwwwwwwwwwwwwww', 0, 0, 12, 1, 0, 0.72, 12.72, 0, 0, 0, 0, 0, '2014-06-23 08:49:57', 0, '0000-00-00 00:00:00'),
(4, 11, 1, 100, '', 'sddddddddddda', 0, 0, 12, 5, 0, 122, 12, 0, 0, 0, 0, 0, '2014-06-23 08:58:43', 0, '0000-00-00 00:00:00'),
(5, 12, 1, 100, '', 'asa', 0, 0, 12, 5, 0, 0, 12, 0, 0, 0, 0, 0, '2014-06-23 09:03:08', 0, '0000-00-00 00:00:00'),
(6, 27, 1, 101, '', 'DAS', 0, 0, 12, 1, 0, 0.72, 12.72, 0, 0, 0, 0, 16, '2014-06-23 10:39:20', 0, '0000-00-00 00:00:00'),
(7, 0, 2, 102, '', 'FEWEQW', 0, 0, 12, 4, 0, 0, 12, 0, 0, 0, 0, 16, '2014-06-23 10:39:34', 0, '0000-00-00 00:00:00'),
(8, 0, 3, 98, '', 'ASA', 0, 0, 12, 6, 0, 12, 12, 0, 0, 0, 0, 16, '2014-06-23 10:40:00', 0, '0000-00-00 00:00:00'),
(9, 28, 1, 100, '', 'AS', 0, 0, 12, 5, 0, 0, 12, 0, 0, 0, 0, 16, '2014-06-23 10:49:52', 0, '0000-00-00 00:00:00'),
(10, 13, 1, 101, '', '12', 0, 0, 12, 1, 0, 0.72, 12.72, 0, 0, 0, 0, 16, '2014-06-23 11:04:08', 0, '0000-00-00 00:00:00'),
(11, 0, 2, 101, '', 'SDS', 0, 0, 12, 3, 0, 0, 12, 0, 0, 0, 0, 16, '2014-06-23 11:13:28', 0, '0000-00-00 00:00:00'),
(12, 14, 1, 100, '', 'ASQ', 0, 0, 1, 4, 0, 0, 1, 0, 0, 0, 0, 16, '2014-06-23 11:16:07', 0, '0000-00-00 00:00:00'),
(13, 0, 2, 101, '', 'sds', 0, 0, 12, 4, 0, 0, 12, 0, 0, 0, 0, 16, '2014-06-23 11:20:57', 0, '0000-00-00 00:00:00'),
(14, 15, 1, 100, '', 'sds', 0, 0, 12, 5, 0, 0, 12, 0, 0, 0, 0, 16, '2014-06-23 11:24:43', 0, '0000-00-00 00:00:00'),
(15, 16, 1, 102, '', 'asa', 0, 0, 12, 4, 0, 0, 12, 0, 0, 0, 0, 16, '2014-06-23 11:26:05', 0, '0000-00-00 00:00:00'),
(16, 17, 1, 100, '', 'wq', 0, 0, 12, 4, 0, 0, 12, 0, 0, 0, 0, 16, '2014-06-23 11:28:30', 0, '0000-00-00 00:00:00'),
(17, 17, 2, 97, '', 'dasda', 0, 0, 12, 2, 0, 0, 12, 0, 0, 0, 0, 16, '2014-06-23 11:59:16', 0, '0000-00-00 00:00:00'),
(18, 18, 1, 102, '', 'sda', 0, 0, 12, 3, 0, 0, 12, 0, 0, 0, 0, 16, '2014-06-24 01:20:25', 0, '0000-00-00 00:00:00'),
(19, 0, 2, 98, '', 'weac', 0, 0, 12, 16, 0, 0.72, 12.72, 0, 0, 0, 0, 16, '2014-06-24 01:20:48', 0, '0000-00-00 00:00:00'),
(20, 19, 1, 101, '', 'wew', 0, 0, 12, 1, 0, 0.72, 12.72, 0, 0, 0, 0, 16, '2014-06-24 01:26:57', 0, '0000-00-00 00:00:00'),
(21, 20, 1, 102, '', 'qwqwqwqwqwq', 0, 0, 12, 4, 0, 12, 12, 0, 0, 0, 0, 16, '2014-06-24 01:28:59', 16, '2014-06-24 02:16:44'),
(22, 20, 2, 2, '', 'qwq', 0, 0, 2, 1, 0, 0.12, 2.12, 0, 0, 0, 0, 16, '2014-06-24 01:29:26', 16, '2014-06-24 03:04:04'),
(23, 20, 3, 101, '', 'JKGGGM DGW', 0, 0, 1, 3, 0, 0, 1, 0, 0, 0, 0, 16, '2014-07-07 01:52:24', 0, '0000-00-00 00:00:00'),
(24, 20, 4, 102, '', 'SD', 0, 0, 1, 2, 0, 0, 1, 0, 0, 0, 0, 16, '2014-07-07 01:54:24', 0, '0000-00-00 00:00:00'),
(25, 20, 5, 101, '', 'DSD', 0, 0, 1, 1, 0, 0.06, 1.06, 0, 0, 0, 0, 16, '2014-07-07 02:03:58', 0, '0000-00-00 00:00:00'),
(26, 20, 6, 101, '', 'DSD', 0, 0, 1, 1, 0, 0.06, 1.06, 0, 0, 0, 0, 16, '2014-07-07 02:06:24', 16, '2014-07-07 02:41:01'),
(28, 20, 8, 99, '', 'SD', 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 16, '2014-07-07 02:10:41', 0, '0000-00-00 00:00:00'),
(31, 20, 7, 101, '', 'sds', 0, 0, 1221, 1, 0, 73.26, 1294.26, 0, 0, 0, 0, 16, '2014-07-07 02:41:38', 0, '0000-00-00 00:00:00'),
(32, 25, 1, 101, '', 'sdad', 0, 0, 22222222222, 1, 0, 1333333333.32, 23555555555.32, 0, 0, 0, 0, 16, '2014-07-14 05:11:15', 16, '2014-07-14 06:04:58'),
(33, 25, 2, 100, '', 'as', 0, 0, 1, 1, 0, 0.06, 1.06, 0, 0, 0, 0, 16, '2014-07-14 05:19:34', 16, '2014-07-14 06:01:39');

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

--
-- Table structure for table `comp_supplier_creditnote_detail`
--

CREATE TABLE IF NOT EXISTS `comp_supplier_creditnote_detail` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `creditnoteID` int(11) NOT NULL,
  `lineNo` int(11) NOT NULL,
  `itemID` int(11) NOT NULL,
  `itemname` varchar(64) NOT NULL,
  `itemdescription` text NOT NULL,
  `quantity` int(11) NOT NULL,
  `unitPrice` double NOT NULL,
  `amountExcludedTax` double NOT NULL,
  `taxID` int(11) NOT NULL,
  `taxRate` double NOT NULL,
  `taxAmount` double NOT NULL,
  `amountIncludedTax` double NOT NULL,
  `accountID` int(11) NOT NULL,
  `createdBy` int(11) NOT NULL,
  `createdTS` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `updatedBy` int(11) NOT NULL,
  `updatedTS` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=41 ;

--
-- Dumping data for table `comp_supplier_creditnote_detail`
--

INSERT INTO `comp_supplier_creditnote_detail` (`ID`, `creditnoteID`, `lineNo`, `itemID`, `itemname`, `itemdescription`, `quantity`, `unitPrice`, `amountExcludedTax`, `taxID`, `taxRate`, `taxAmount`, `amountIncludedTax`, `accountID`, `createdBy`, `createdTS`, `updatedBy`, `updatedTS`) VALUES
(1, 1, 1, 4, 'Plastic Chair - Blue', '331000100', 2, 120, 240, 1, 6, 14.4, 254.4, 0, 1, '2014-06-17 05:35:04', 0, '0000-00-00 00:00:00'),
(2, 1, 2, 7, 'Plastic Chair - Red', '331000200', 5, 12, 60, 18, 6, 3.6, 63.6, 0, 1, '2014-06-17 05:35:06', 0, '0000-00-00 00:00:00'),
(3, 2, 1, 8, 'Plastic Chair - White', '331000300', 100, 34, 3400, 28, 10, 340, 3740, 0, 1, '2014-06-17 05:35:07', 0, '0000-00-00 00:00:00'),
(4, 2, 2, 9, 'Nasi Goreng Ayam', '501012000', 25, 23, 575, 10, 6, 34.5, 609.5, 0, 1, '2014-06-17 05:35:09', 0, '0000-00-00 00:00:00'),
(5, 3, 1, 2, 'Steel chair for outdoor', '100300100', 200, 300, 60000, 1, 6, 3600, 63600, 0, 1, '2014-06-17 05:35:10', 0, '0000-00-00 00:00:00'),
(6, 3, 2, 2, 'Steel chair for outdoor', '100300100', 5, 290, 1450, 1, 6, 87, 1537, 0, 1, '2014-06-17 05:35:12', 0, '0000-00-00 00:00:00'),
(7, 4, 0, 0, '0', 'Teak wooden chair with natural finish', 2, 10, 20, 0, 6, 1.2, 21.2, 0, 16, '2014-06-23 05:06:24', 0, '0000-00-00 00:00:00'),
(8, 5, 0, 1, '0', 'Teak wooden chair with natural finish', 12, 12, 144, 0, 6, 8.64, 152.64, 0, 16, '2014-06-23 07:36:57', 0, '0000-00-00 00:00:00'),
(9, 5, 0, 0, '0', 'Teak wooden chair with natural finish', 12, 12, 144, 0, 6, 8.64, 152.64, 0, 16, '2014-06-23 07:38:23', 0, '0000-00-00 00:00:00'),
(10, 6, 0, 7, '0', 'Plastic Chair - Red', 12, 2, 28, 5, 12, 3376.8, 31516.8, 0, 16, '2014-06-23 07:51:34', 0, '0000-00-00 00:00:00'),
(11, 6, 0, 0, '0', 'Teak wooden chair with natural finish', 12, 12, 144, 0, 6, 8.64, 152.64, 0, 16, '2014-06-23 07:51:57', 0, '0000-00-00 00:00:00'),
(12, 7, 0, 1, '0', 'Teak wooden chair with natural finish', 1, 0.12, 0, 0, 6, 0.0072, 0.1272, 0, 16, '2014-06-23 08:00:38', 0, '0000-00-00 00:00:00'),
(13, 7, 0, 0, '0', 'Plastic Chair - Red', 12, 2, 28, 0, 1, 281.4, 28421.4, 0, 16, '2014-06-23 08:00:54', 0, '0000-00-00 00:00:00'),
(14, 8, 0, 1, '0', 'Teak wooden chair with natural finish', 12, 12, 144, 0, 6, 8.64, 152.64, 0, 16, '2014-06-23 08:02:28', 0, '0000-00-00 00:00:00'),
(15, 8, 0, 0, '0', 'Plastic Chair - Red', 1, 2, 2, 0, 0, 0, 2345, 0, 16, '2014-06-23 08:02:39', 0, '0000-00-00 00:00:00'),
(16, 13, 0, 7, '0', 'Plastic Chair - Red', 1, 2, 2, 0, 0, 0, 2345, 0, 16, '2014-06-23 11:03:41', 0, '0000-00-00 00:00:00'),
(17, 0, 0, 4, '', 'Plastic Chair - Blue', 1, 0.12, 0, 1, 0, 0, 0.12, 0, 16, '2014-06-23 11:09:19', 0, '0000-00-00 00:00:00'),
(18, 14, 0, 4, '0', 'Plastic Chair - Blue', 1, 120, 120, 4, 1, 1.2, 121.2, 0, 16, '2014-06-23 11:15:20', 0, '0000-00-00 00:00:00'),
(19, 14, 0, 4, '', 'Plastic Chair - Blue', 1, 12, 12, 1, 1, 0.12, 12.12, 0, 16, '2014-06-23 11:15:42', 0, '0000-00-00 00:00:00'),
(20, 17, 0, 4, '', 'Plastic Chair - Blue', 12, 0, 0, 1, 0, 0, 0, 0, 16, '2014-06-23 11:29:21', 0, '0000-00-00 00:00:00'),
(21, 17, 0, 4, '', 'Plastic Chair - Blue', 2, 12, 24, 6, 1, 0.24, 24.24, 0, 16, '2014-06-23 11:30:03', 0, '0000-00-00 00:00:00'),
(22, 18, 1, 1, '0', 'Teak wooden chair with natural finish', 2, 12, 24, 13, 6, 1.44, 25.44, 0, 16, '2014-06-24 01:18:33', 0, '0000-00-00 00:00:00'),
(23, 18, 2, 7, '', 'Plastic Chair - Red', 12, 2, 28, 0, 21, 5909.4, 34049.4, 0, 16, '2014-06-24 01:19:41', 0, '0000-00-00 00:00:00'),
(24, 19, 1, 4, '0', 'Plastic Chair - Blue', 1, 1, 1, 1, 0, 0, 1, 0, 16, '2014-06-24 01:26:34', 0, '0000-00-00 00:00:00'),
(25, 20, 1, 4, '0', 'Plastic Chair - Blue', 1, 1, 1, 1, 6, 0.06, 1.06, 0, 16, '2014-06-24 02:55:48', 16, '0000-00-00 00:00:00'),
(26, 20, 2, 7, '', 'Plastic Chair - Red', 12, 2, 28, 0, 1, 281.4, 28421.4, 0, 16, '2014-06-24 01:30:15', 0, '0000-00-00 00:00:00'),
(31, 20, 3, 1, '', 'Teak wooden chair with natural finish', 1, 0, 10, 0, 6, 0.6, 10.6, 0, 16, '2014-07-07 04:12:19', 16, '0000-00-00 00:00:00'),
(32, 21, 1, 1, '0', 'Teak wooden chair with natural finish', 1, 1, 1, 0, 6, 0.06, 1.06, 0, 16, '2014-07-14 04:45:59', 0, '0000-00-00 00:00:00'),
(33, 21, 2, 1, '', 'Teak wooden chair with natural finish', 1, 1, 1, 0, 6, 0.06, 1.06, 0, 16, '2014-07-14 04:52:24', 0, '0000-00-00 00:00:00'),
(34, 22, 1, 1, '0', 'Teak wooden chair with natural finish', 1, 1, 1, 0, 6, 0.06, 1.06, 0, 16, '2014-07-14 04:55:42', 0, '0000-00-00 00:00:00'),
(35, 22, 2, 4, '', 'Plastic Chair - Blue', 2, 2, 4, 1, 0, 0, 4, 0, 16, '2014-07-14 04:56:38', 0, '0000-00-00 00:00:00'),
(36, 23, 1, 7, '0', 'Plastic Chair - Red', 1, 1, 1, 1, 6, 0.06, 1.06, 0, 16, '2014-07-14 05:03:55', 0, '0000-00-00 00:00:00'),
(37, 24, 1, 7, '0', 'Plastic Chair - Red', 1, 1, 1, 0, 0, 0, 1, 0, 16, '2014-07-14 05:08:21', 0, '0000-00-00 00:00:00'),
(38, 24, 2, 1, '', 'Teak wooden chair with natural finish', 1, 0.01, 0, 0, 6, 0.0006, 0.01, 0, 16, '2014-07-14 05:08:53', 0, '0000-00-00 00:00:00'),
(39, 25, 1, 1, '0', 'Teak wooden chair with natural finish', 1, 1, 1, 0, 6, 0.06, 1.06, 0, 16, '2014-07-14 05:10:22', 0, '0000-00-00 00:00:00'),
(40, 25, 2, 1, '', 'Teak wooden chair with natural finish', 1, 1, 1, 0, 6, 0.06, 1.06, 0, 16, '2014-07-14 05:18:41', 0, '0000-00-00 00:00:00');

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

--
-- Table structure for table `comp_supplier_debitnote`
--

CREATE TABLE IF NOT EXISTS `comp_supplier_debitnote` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `serialNo` int(11) NOT NULL DEFAULT '1',
  `companyID` int(11) NOT NULL,
  `supplierID` int(11) NOT NULL,
  `formNo` varchar(32) NOT NULL,
  `debitNoteDate` date NOT NULL,
  `supplierInvoiceID` int(11) NOT NULL,
  `projectID` int(11) NOT NULL,
  `termsID` int(11) NOT NULL,
  `currencyID` int(11) NOT NULL,
  `exchangeRate` double NOT NULL,
  `agentID` int(11) NOT NULL,
  `memo` text NOT NULL,
  `employeeID` int(11) NOT NULL,
  `shippingMethodID` int(11) NOT NULL,
  `totalAmount` double NOT NULL,
  `amountPaid` decimal(10,0) NOT NULL,
  `totalTaxAmount` double NOT NULL,
  `totalPayable` double NOT NULL,
  `total` 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` smallint(16) NOT NULL,
  `updateAble` tinyint(1) NOT NULL DEFAULT '1',
  `journalNo` varchar(32) NOT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=34 ;

--
-- Dumping data for table `comp_supplier_debitnote`
--

INSERT INTO `comp_supplier_debitnote` (`ID`, `serialNo`, `companyID`, `supplierID`, `formNo`, `debitNoteDate`, `supplierInvoiceID`, `projectID`, `termsID`, `currencyID`, `exchangeRate`, `agentID`, `memo`, `employeeID`, `shippingMethodID`, `totalAmount`, `amountPaid`, `totalTaxAmount`, `totalPayable`, `total`, `createdBy`, `createdTS`, `updatedBy`, `updatedTS`, `is_delete`, `updateAble`, `journalNo`) VALUES
(1, 1, 1, 20, 'PDN', '2014-06-02', 74, 1, 0, 1, 1, 0, 'fdv dfd', 0, 0, 0, '0', 0, 0, 0, 0, '2014-06-02 04:20:32', 0, '2014-06-17 11:22:11', 0, 1, ''),
(2, 1, 1, 1, 'PDN', '2014-06-03', 73, 1, 0, 1, 1, 0, 'fdv dfd', 0, 0, 0, '0', 0, 0, 0, 0, '2014-06-03 03:36:57', 0, '2014-06-17 11:22:13', 0, 1, ''),
(3, 1, 1, 1, 'PDN', '2014-06-11', 71, 1, 0, 1, 1, 0, 'fdv dfd', 0, 0, 0, '0', 0, 0, 0, 16, '2014-06-11 08:47:00', 0, '2014-06-17 11:22:17', 0, 0, ''),
(4, 1, 1, 20, 'PDN', '2014-06-12', 74, 10, 0, 1, 1, 0, 'fdv dfd', 0, 0, 0, '0', 0, 0, 0, 16, '2014-06-12 01:05:39', 0, '2014-06-17 11:22:18', 0, 0, ''),
(5, 1, 1, 20, 'PDN', '2014-06-16', 74, 10, 0, 2, 2, 0, '', 0, 0, 0, '0', 0, 0, 0, 16, '2014-06-16 06:46:52', 0, '2014-06-20 04:28:10', 0, 0, 'AP20140600000013'),
(6, 1, 1, 1, 'PDN', '2014-06-21', 71, 10, 0, 1, 1, 0, 'sdsdca', 0, 0, 28140, '0', 1688.4, 29828.4, 0, 16, '2014-06-21 04:32:45', 0, '0000-00-00 00:00:00', 0, 1, ''),
(7, 1, 1, 1, 'PDN', '2014-06-21', 71, 10, 0, 1, 2, 0, 'sa adED AE', 0, 0, 144, '0', 8.64, 152.64, 0, 16, '2014-06-21 05:08:45', 0, '0000-00-00 00:00:00', 0, 1, ''),
(8, 1, 1, 1, 'PDN', '2014-06-21', 72, 1, 0, 1, 2, 0, 'sdsds', 0, 0, 144, '0', 8.64, 152.64, 0, 16, '2014-06-21 05:17:14', 0, '0000-00-00 00:00:00', 0, 1, ''),
(9, 1, 1, 1, 'PDN', '2014-06-21', 71, 1, 0, 1, 1, 0, 'sds', 0, 0, 1200, '0', 72, 1272, 0, 16, '2014-06-21 05:43:08', 0, '0000-00-00 00:00:00', 0, 1, ''),
(10, 1, 1, 1, 'PDN', '2014-06-21', 71, 1, 0, 1, 1, 0, 'as', 0, 0, 0, '0', 0, 2, 0, 16, '2014-06-21 07:06:53', 0, '2014-06-21 07:07:53', 0, 1, ''),
(11, 1, 1, 20, 'PDN', '2014-06-21', 76, 10, 0, 1, 1, 0, 'as', 0, 0, 2345, '0', 281.4, 2626.4, 0, 16, '2014-06-21 07:23:44', 0, '0000-00-00 00:00:00', 0, 1, ''),
(12, 1, 1, 1, 'PDN', '2014-06-21', 71, 16, 0, 1, 2, 0, 'sds', 0, 0, 28140, '0', 281.4, 28421.4, 0, 16, '2014-06-21 07:41:36', 0, '0000-00-00 00:00:00', 0, 1, ''),
(13, 1, 1, 20, 'PDN', '2014-06-21', 74, 2, 0, 1, 1, 0, 'asa', 0, 0, 12, '0', 0, 144, 0, 16, '2014-06-21 07:49:30', 0, '2014-06-21 08:10:23', 0, 1, ''),
(14, 1, 1, 1, 'PDN', '2014-06-21', 72, 17, 0, 1, 1, 0, 'qwq', 0, 0, 2, '0', 0.12, 2.12, 0, 16, '2014-06-21 08:21:50', 0, '0000-00-00 00:00:00', 0, 1, ''),
(15, 1, 1, 1, 'PDN', '2014-06-21', 71, 17, 0, 1, 2, 0, 'asasdad', 0, 0, 144, '0', 8.64, 0, 0, 16, '2014-06-21 08:50:38', 0, '2014-06-21 08:51:07', 0, 1, ''),
(16, 1, 1, 20, 'PDN', '2014-06-23', 74, 16, 0, 1, 1, 0, 'dsd', 0, 0, 12, '0', 0.72, 12.72, 0, 16, '2014-06-23 03:33:39', 0, '0000-00-00 00:00:00', 0, 1, ''),
(17, 1, 1, 20, 'PDN', '2014-06-23', 74, 16, 0, 1, 1, 0, 'dsd', 0, 0, 12, '0', 0.72, 12.72, 0, 16, '2014-06-23 03:35:57', 0, '0000-00-00 00:00:00', 0, 1, ''),
(18, 1, 1, 20, 'PDN', '2014-06-23', 74, 16, 0, 1, 1, 0, 'dsd', 0, 0, 12, '0', 0.72, 12.72, 0, 16, '2014-06-23 03:37:06', 0, '0000-00-00 00:00:00', 0, 1, ''),
(19, 1, 1, 20, 'PDN', '2014-06-23', 74, 16, 0, 1, 1, 0, 'dsd', 0, 0, 12, '0', 0.72, 12.72, 0, 16, '2014-06-23 03:38:33', 0, '0000-00-00 00:00:00', 0, 1, ''),
(20, 1, 1, 20, 'PDN', '2014-06-23', 74, 16, 0, 1, 1, 0, 'dsd', 0, 0, 12, '0', 0.72, 12.72, 0, 16, '2014-06-23 03:39:30', 0, '0000-00-00 00:00:00', 0, 1, ''),
(21, 1, 1, 1, 'PDN', '2014-06-23', 71, 1, 0, 1, 1, 0, '', 0, 0, 12, '0', 0, 12, 0, 16, '2014-06-23 03:50:34', 0, '0000-00-00 00:00:00', 0, 1, ''),
(22, 1, 1, 1, 'PDN', '2014-06-23', 71, 1, 0, 1, 1, 0, 'ccxc', 0, 0, 156, '0', 0.72, 156.72, 0, 16, '2014-06-23 04:20:21', 0, '2014-06-23 04:20:39', 0, 1, ''),
(23, 1, 1, 1, 'PDN', '2014-06-23', 71, 1, 0, 1, 1, 0, '', 0, 0, 265, '0', 24.54, 289.53999999999996, 0, 16, '2014-06-23 04:25:24', 0, '2014-06-23 04:25:38', 0, 1, ''),
(24, 1, 1, 20, 'PDN', '2014-06-23', 74, 15, 0, 1, 1, 0, 'fac sfa', 0, 0, 12, '0', 0.72, 12.72, 0, 16, '2014-06-23 09:47:53', 0, '0000-00-00 00:00:00', 0, 1, ''),
(25, 1, 1, 1, 'PDN', '2014-06-23', 71, 16, 0, 1, 1, 0, '', 0, 0, 1.06, '0', 0.06, 1.06, 0, 16, '2014-06-23 09:50:16', 0, '2014-07-14 05:19:34', 0, 1, ''),
(26, 1, 1, 1, 'PDN', '2014-06-23', 71, 10, 0, 1, 1, 0, 'sa DEc', 0, 0, 1596, '0', 72, 1668, 0, 16, '2014-06-23 10:35:58', 0, '2014-06-23 10:36:38', 0, 1, ''),
(27, 1, 1, 23, 'PCN', '2014-06-23', 93, 2, 0, 0, 3.6, 0, '', 0, 0, 144, '0', 0, 0, 0, 16, '2014-06-23 10:38:49', 0, '2014-06-23 10:38:59', 0, 1, ''),
(28, 1, 1, 1, 'PCN', '2014-06-23', 71, 1, 0, 0, 1, 0, 'SDSD', 0, 0, 144, '0', 8.64, 0, 0, 16, '2014-06-23 10:48:49', 0, '2014-06-23 10:49:09', 0, 1, ''),
(29, 1, 1, 1, 'PCN', '2014-06-23', 71, 16, 0, 0, 1, 0, 'SSDS', 0, 0, 2345, '0', 0, 2345, 0, 16, '2014-06-23 10:56:46', 0, '0000-00-00 00:00:00', 0, 1, ''),
(30, 1, 1, 1, 'PDN', '2014-06-24', 71, 1, 0, 0, 0, 0, '', 0, 0, 26, '0', 1.56, 0, 0, 16, '2014-06-24 04:21:28', 0, '2014-07-09 04:09:10', 0, 0, 'AP20140600000014'),
(31, 1, 1, 1, 'PDN', '2014-06-24', 71, 17, 0, 0, 12, 0, 'wdee', 0, 0, 125, '0', 7.32, 0, 0, 16, '2014-06-24 04:53:19', 0, '2014-06-24 04:54:10', 0, 1, ''),
(32, 1, 1, 1, 'PDN', '2014-07-14', 72, 15, 0, 1, 1, 0, 'asd', 0, 0, 15323.77, '0', 756.77, 2368.45, 0, 16, '2014-07-14 03:37:34', 0, '2014-07-14 03:41:14', 0, 1, ''),
(33, 1, 1, 20, 'PDN', '2014-07-14', 76, 15, 0, 1, 1, 0, 'sds', 0, 0, 4.24, '0', 0.24, 1.06, 0, 16, '2014-07-14 03:42:17', 0, '2014-07-14 04:20:09', 0, 1, '');

--
-- Triggers `comp_supplier_debitnote`
--
DROP TRIGGER IF EXISTS `trigger_before_insert_sdno_add_serialNo`;
DELIMITER //
CREATE TRIGGER `trigger_before_insert_sdno_add_serialNo` BEFORE INSERT ON `comp_supplier_debitnote`
 FOR EACH ROW set new.serialNo = (select nextSerialNo 
			   from view_serial_comp_supplier_debitnote
			   where companyID = new.companyID)
//
DELIMITER ;

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

--
-- Table structure for table `comp_supplier_debitnote_charges`
--

CREATE TABLE IF NOT EXISTS `comp_supplier_debitnote_charges` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `debitNoteID` int(11) NOT NULL,
  `lineNo` int(11) NOT NULL,
  `accountNoID` int(11) NOT NULL,
  `itemname` varchar(64) NOT NULL,
  `itemdescription` text NOT NULL,
  `quantity` int(11) NOT NULL,
  `unitPrice` double NOT NULL,
  `amountExcludedTax` double NOT NULL,
  `taxID` int(11) NOT NULL,
  `taxRate` double NOT NULL,
  `taxAmount` double NOT NULL,
  `amountIncludedTax` double NOT NULL,
  `drAccountID` int(11) NOT NULL,
  `crAccountID` int(11) NOT NULL,
  `drTaxAccountID` int(11) NOT NULL,
  `crTaxAccountID` 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 '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=51 ;

--
-- Dumping data for table `comp_supplier_debitnote_charges`
--

INSERT INTO `comp_supplier_debitnote_charges` (`ID`, `debitNoteID`, `lineNo`, `accountNoID`, `itemname`, `itemdescription`, `quantity`, `unitPrice`, `amountExcludedTax`, `taxID`, `taxRate`, `taxAmount`, `amountIncludedTax`, `drAccountID`, `crAccountID`, `drTaxAccountID`, `crTaxAccountID`, `createdBy`, `createdTS`, `updatedBy`, `updatedTS`) VALUES
(26, 19, 1, 102, '', 'qwq', 0, 0, 12, 1, 0, 0.72, 12.72, 0, 0, 0, 0, 0, '2014-06-23 03:38:33', 0, '0000-00-00 00:00:00'),
(27, 20, 1, 102, '', 'qwq', 0, 0, 12, 1, 0, 0.72, 12.72, 0, 0, 0, 0, 0, '2014-06-23 03:39:30', 0, '0000-00-00 00:00:00'),
(28, 27, 1, 102, '', 'qwq', 0, 0, 12, 1, 0, 0.72, 12.72, 0, 0, 0, 0, 0, '2014-06-23 03:39:47', 0, '0000-00-00 00:00:00'),
(29, 21, 1, 100, '', 'sd', 0, 0, 12, 4, 0, 0, 12, 0, 0, 0, 0, 0, '2014-06-23 03:50:34', 0, '0000-00-00 00:00:00'),
(30, 22, 1, 101, '', 'sdsd', 0, 0, 12, 1, 0, 0.72, 12.72, 0, 0, 0, 0, 0, '2014-06-23 04:20:39', 0, '0000-00-00 00:00:00'),
(31, 0, 2, 102, '', 'aasa', 0, 0, 12, 18, 0, 0.72, 12.72, 0, 0, 0, 0, 0, '2014-06-23 04:21:37', 0, '0000-00-00 00:00:00'),
(32, 23, 1, 101, '', '121as', 0, 0, 121, 1, 0, 7.26, 128.26, 0, 0, 0, 0, 0, '2014-06-23 04:25:38', 0, '0000-00-00 00:00:00'),
(33, 24, 1, 102, '', '12sds', 0, 0, 12, 1, 0, 0.72, 12.72, 0, 0, 0, 0, 0, '2014-06-23 09:47:53', 0, '0000-00-00 00:00:00'),
(34, 25, 1, 102, '', 'asa', 0, 0, 1, 1, 0, 0.06, 1.06, 0, 0, 0, 0, 0, '2014-06-23 09:50:16', 0, '0000-00-00 00:00:00'),
(35, 26, 1, 102, '', 'ASA', 0, 0, 12, 4, 0, 0, 12, 0, 0, 0, 0, 16, '2014-06-23 10:36:38', 0, '0000-00-00 00:00:00'),
(36, 0, 2, 102, '', 'ASA', 0, 0, 1, 12, 0, 0.05, 1.05, 0, 0, 0, 0, 16, '2014-06-23 10:36:55', 0, '0000-00-00 00:00:00'),
(37, 30, 1, 101, '', '1sdas', 0, 0, 12, 1, 0, 0.72, 12.72, 0, 0, 0, 0, 16, '2014-06-24 04:35:41', 0, '0000-00-00 00:00:00'),
(38, 0, 2, 97, '', 'xad', 0, 0, 1, 3, 0, 0, 1, 0, 0, 0, 0, 16, '2014-06-24 04:49:56', 0, '0000-00-00 00:00:00'),
(39, 31, 1, 99, '', 'sdaqw', 0, 0, 2, 14, 0, 7.32, 129.32, 0, 0, 0, 0, 16, '2014-06-24 04:53:20', 16, '2014-06-24 06:19:19'),
(40, 31, 2, 85, '', '2323211', 0, 0, 122, 13, 0, 12, 3, 0, 0, 0, 0, 16, '2014-06-24 04:53:42', 16, '2014-06-24 06:35:37'),
(41, 0, 2, 102, '', 'SDS', 0, 0, 12, 4, 0, 0, 12, 0, 0, 0, 0, 16, '2014-07-04 06:39:50', 0, '0000-00-00 00:00:00'),
(42, 0, 2, 101, '', 'SD', 0, 0, 1, 1, 0, 0.06, 1.06, 0, 0, 0, 0, 16, '2014-07-04 06:40:41', 0, '0000-00-00 00:00:00'),
(43, 30, 2, 101, '', 'asa', 0, 0, 1, 1, 0, 0.06, 1.06, 0, 0, 0, 0, 16, '2014-07-04 06:44:55', 0, '0000-00-00 00:00:00'),
(47, 30, 3, 101, '', 'vvc', 0, 0, 1, 1, 0, 0.06, 1.06, 0, 0, 0, 0, 16, '2014-07-04 07:25:54', 0, '0000-00-00 00:00:00'),
(48, 32, 1, 101, '', 'asa', 0, 0, 11111, 1, 0, 666.66, 11777.66, 0, 0, 0, 0, 16, '2014-07-14 03:41:14', 0, '0000-00-00 00:00:00'),
(49, 33, 1, 102, '', 'sds', 0, 0, 1, 1, 0, 0.06, 1.06, 0, 0, 0, 0, 16, '2014-07-14 03:42:17', 0, '0000-00-00 00:00:00'),
(50, 33, 2, 102, '', 'aq', 0, 0, 1, 1, 0, 0.06, 1.06, 0, 0, 0, 0, 16, '2014-07-14 03:42:56', 16, '2014-07-14 04:13:43');

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

--
-- Table structure for table `comp_supplier_debitnote_detail`
--

CREATE TABLE IF NOT EXISTS `comp_supplier_debitnote_detail` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `debitnoteID` int(11) NOT NULL,
  `lineNo` int(11) NOT NULL,
  `itemID` int(11) NOT NULL,
  `itemname` varchar(64) NOT NULL,
  `itemdescription` text NOT NULL,
  `quantity` int(11) NOT NULL,
  `unitPrice` double NOT NULL,
  `amountExcludedTax` double NOT NULL,
  `taxID` int(11) NOT NULL,
  `taxRate` double NOT NULL,
  `taxAmount` double NOT NULL,
  `amountIncludedTax` double NOT NULL,
  `accountID` int(11) NOT NULL,
  `createdBy` int(11) NOT NULL,
  `createdTS` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `updatedBy` int(11) NOT NULL,
  `updatedTS` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=48 ;

--
-- Dumping data for table `comp_supplier_debitnote_detail`
--

INSERT INTO `comp_supplier_debitnote_detail` (`ID`, `debitnoteID`, `lineNo`, `itemID`, `itemname`, `itemdescription`, `quantity`, `unitPrice`, `amountExcludedTax`, `taxID`, `taxRate`, `taxAmount`, `amountIncludedTax`, `accountID`, `createdBy`, `createdTS`, `updatedBy`, `updatedTS`) VALUES
(1, 1, 1, 4, 'Plastic Chair - Blue', '331000100', 1, 300, 300, 1, 6, 18, 318, 0, 0, '2014-06-17 11:21:33', 0, '0000-00-00 00:00:00'),
(2, 1, 2, 8, 'Plastic Chair - White', '331000300', 1, 450, 450, 28, 10, 45, 495, 0, 0, '2014-06-17 11:21:35', 0, '0000-00-00 00:00:00'),
(3, 2, 1, 10, 'Bola Tampar Buaya', 'B01', 3, 10, 30, 0, 0, 0, 30, 0, 0, '2014-06-17 11:21:37', 0, '0000-00-00 00:00:00'),
(4, 3, 1, 2, 'Steel chair for outdoor', 'B13 Steel Chair', 2, 1, 2, 1, 6, 0.12, 2.12, 0, 16, '2014-06-17 11:21:38', 0, '0000-00-00 00:00:00'),
(5, 4, 1, 2, 'Steel chair for outdoor', 'B13 Steel Chair', 2, 12, 24, 1, 6, 1.44, 25.44, 0, 16, '2014-06-17 11:21:40', 0, '0000-00-00 00:00:00'),
(6, 4, 2, 1, 'Teak wooden chair with natural finish', 'A12 Wooden Chair', 1, 1, 1, 0, 1, 0.01, 1.01, 0, 16, '2014-06-17 11:21:41', 0, '0000-00-00 00:00:00'),
(7, 5, 1, 4, 'Plastic Chair - Blue', 'A23 Plastic Chair', 3, 3, 9, 1, 6, 0.54, 9.54, 0, 16, '2014-06-17 11:21:43', 0, '0000-00-00 00:00:00'),
(8, 7, 0, 4, '', 'Plastic Chair - Blue', 12, 12, 0, 1, 6, 0, 0, 0, 16, '2014-06-21 05:08:45', 0, '0000-00-00 00:00:00'),
(9, 8, 0, 1, '', 'Teak wooden chair with natural finish', 12, 12, 0, 1, 6, 0, 0, 0, 16, '2014-06-21 05:17:14', 0, '0000-00-00 00:00:00'),
(10, 8, 0, 1, '', 'Teak wooden chair with natural finish', 12, 12, 0, 14, 6, 0, 0, 0, 16, '2014-06-21 05:17:42', 0, '0000-00-00 00:00:00'),
(11, 9, 0, 1, '', 'Teak wooden chair with natural finish', 1, 1200, 0, 1, 6, 0, 0, 0, 16, '2014-06-21 05:43:08', 0, '0000-00-00 00:00:00'),
(12, 10, 0, 1, '', 'Teak wooden chair with natural finish', 12, 0, 0, 3, 0, 0, 0, 0, 16, '2014-06-21 07:06:53', 0, '0000-00-00 00:00:00'),
(13, 10, 0, 1, '', 'Teak wooden chair with natural finish', 1, 12, 0, 6, 0, 0, 0, 0, 16, '2014-06-21 07:07:12', 0, '0000-00-00 00:00:00'),
(14, 10, 0, 8, '', 'Plastic Chair - White', 2, 0, 0, 3, 0, 0, 0, 0, 16, '2014-06-21 07:07:53', 0, '0000-00-00 00:00:00'),
(15, 11, 0, 7, '', 'Plastic Chair - Red', 1, 2345, 0, 0, 12, 0, 0, 0, 16, '2014-06-21 07:23:44', 0, '0000-00-00 00:00:00'),
(16, 12, 0, 7, '', 'Plastic Chair - Red', 12, 2345, 28140, 0, 1, 281.4, 28421.4, 0, 16, '2014-06-21 07:41:36', 0, '0000-00-00 00:00:00'),
(17, 13, 0, 8, '', 'Plastic Chair - White', 12, 1, 12, 28, 0, 0, 12, 0, 16, '2014-06-21 07:49:31', 0, '0000-00-00 00:00:00'),
(18, 13, 0, 9, '', 'Nasi Goreng Ayam', 21, 1, 0, 26, 2, 0, 0, 0, 16, '2014-06-21 07:49:54', 0, '0000-00-00 00:00:00'),
(19, 13, 0, 8, '', 'Plastic Chair - White', 12, 12, 0, 28, 0, 0, 0, 0, 16, '2014-06-21 08:10:23', 0, '0000-00-00 00:00:00'),
(20, 14, 0, 1, '', 'Teak wooden chair with natural finish', 2, 1, 2, 0, 6, 0.12, 2.12, 0, 16, '2014-06-21 08:21:50', 0, '0000-00-00 00:00:00'),
(21, 15, 1, 1, '0', 'Teak wooden chair with natural finish', 12, 12, 144, 13, 6, 8.64, 152.64, 0, 16, '2014-06-23 01:57:22', 16, '0000-00-00 00:00:00'),
(22, 15, 2, 8, '0', 'Plastic Chair - White', 12, 3244, 38928, 28, 1, 389.28, 39317.28, 0, 16, '2014-06-23 01:57:30', 16, '0000-00-00 00:00:00'),
(23, 15, 3, 10, '0', 'Bola Tampar Buaya', 22, 12, 264, 13, 1, 2.64, 266.64, 0, 16, '2014-06-23 01:57:39', 16, '0000-00-00 00:00:00'),
(24, 15, 4, 8, '', 'Plastic Chair - White', 23, 12, 276, 28, 12, 33.12, 309.12, 0, 16, '2014-06-21 08:59:54', 0, '0000-00-00 00:00:00'),
(25, 29, 1, 7, '', 'Plastic Chair - Red', 1, 2345, 2345, 0, 0, 0, 2345, 0, 16, '2014-06-23 03:51:06', 0, '0000-00-00 00:00:00'),
(26, 22, 1, 4, '', 'Plastic Chair - Blue', 12, 12, 144, 4, 0, 0, 144, 0, 16, '2014-06-23 04:20:21', 0, '0000-00-00 00:00:00'),
(27, 23, 1, 1, '', 'Teak wooden chair with natural finish', 12, 12, 144, 7, 12, 17.28, 161.28, 0, 16, '2014-06-23 04:25:24', 0, '0000-00-00 00:00:00'),
(28, 0, 1, 7, '', 'Plastic Chair - Red', 9, 2345, 21105, 0, 0, 0, 21105, 0, 16, '2014-06-23 08:51:32', 0, '0000-00-00 00:00:00'),
(29, 26, 1, 4, '', 'Plastic Chair - Blue', 12, 12, 144, 3, 0, 0, 144, 0, 16, '2014-06-23 10:35:58', 0, '0000-00-00 00:00:00'),
(30, 26, 2, 1, '', 'Teak wooden chair with natural finish', 12, 120, 1440, 12, 5, 72, 1512, 0, 16, '2014-06-23 10:36:24', 0, '0000-00-00 00:00:00'),
(31, 27, 1, 1, '', 'Teak wooden chair with natural finish', 12, 12, 144, 3, 0, 0, 144, 0, 16, '2014-06-23 10:38:49', 0, '0000-00-00 00:00:00'),
(32, 27, 2, 10, '', 'Bola Tampar Buaya', 1, 111, 111, 0, 6, 6.66, 117.66, 0, 16, '2014-06-23 10:38:59', 0, '0000-00-00 00:00:00'),
(33, 0, 3, 2, '', 'Steel chair for outdoor', 12, 3244, 38928, 1, 0, 0, 38928, 0, 16, '2014-06-23 10:41:59', 0, '0000-00-00 00:00:00'),
(34, 28, 1, 4, '', 'Plastic Chair - Blue', 12, 12, 144, 13, 6, 8.64, 152.64, 0, 16, '2014-06-23 10:48:49', 0, '0000-00-00 00:00:00'),
(35, 28, 2, 7, '', 'Plastic Chair - Red', 1, 2345, 2345, 0, 0, 0, 2345, 0, 16, '2014-06-23 10:49:09', 0, '0000-00-00 00:00:00'),
(36, 29, 1, 7, '', 'Plastic Chair - Red', 1, 2345, 2345, 0, 0, 0, 2345, 0, 16, '2014-06-23 10:56:46', 0, '0000-00-00 00:00:00'),
(37, 30, 1, 4, '', 'Plastic Chair - Blue', 1, 1, 1, 1, 0, 0, 1, 0, 16, '2014-07-04 07:39:00', 16, '0000-00-00 00:00:00'),
(38, 31, 1, 7, '', 'Plastic Chair - Red', 1, 2345, 2345, 0, 12, 281.4, 2626.4, 0, 16, '2014-06-24 04:54:10', 0, '0000-00-00 00:00:00'),
(40, 30, 2, 1, '', 'Teak wooden chair with natural finish', 1, 1, 1, 0, 6, 0.06, 1.06, 0, 16, '2014-07-04 07:45:05', 0, '0000-00-00 00:00:00'),
(41, 30, 3, 1, '', 'Teak wooden chair with natural finish', 1, 1, 1, 0, 6, 0.06, 1.06, 0, 16, '2014-07-04 07:54:53', 0, '0000-00-00 00:00:00'),
(43, 30, 4, 1, '', 'Teak wooden chair with natural finish', 1, 1, 1, 0, 6, 0.06, 1.06, 0, 16, '2014-07-04 07:57:03', 0, '0000-00-00 00:00:00'),
(45, 32, 1, 7, '', 'Plastic Chair - Red', 1, 2345, 2345, 0, 1, 23.45, 2368.45, 0, 16, '2014-07-14 03:37:34', 0, '0000-00-00 00:00:00'),
(46, 32, 2, 1, '', 'Teak wooden chair with natural finish', 1, 1111, 1111, 0, 6, 66.66, 1177.66, 0, 16, '2014-07-14 03:39:55', 0, '0000-00-00 00:00:00'),
(47, 33, 1, 1, '', 'Teak wooden chair with natural finish', 2, 1, 2, 0, 6, 0.12, 2.12, 0, 16, '2014-07-14 04:20:09', 16, '0000-00-00 00:00:00');

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

--
-- Table structure for table `comp_supplier_invoice`
--

CREATE TABLE IF NOT EXISTS `comp_supplier_invoice` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `serialNo` int(11) NOT NULL DEFAULT '1',
  `companyID` int(11) NOT NULL,
  `purchaseInvoiceCodeID` int(11) NOT NULL COMMENT '1=puchase inv, 2=direct purch inv, 3=debit note, 4=credit note',
  `purchaserID` int(11) NOT NULL,
  `supplierID` int(11) NOT NULL,
  `formNo` varchar(32) NOT NULL,
  `invoiceDate` date NOT NULL,
  `supplierInvoiceNo` varchar(32) NOT NULL,
  `projectID` int(11) NOT NULL,
  `termsID` int(11) NOT NULL,
  `shipToID` int(11) NOT NULL,
  `locationID` int(11) NOT NULL,
  `currencyID` int(11) NOT NULL,
  `exchangeRate` double NOT NULL,
  `agentID` int(11) NOT NULL,
  `memo` text NOT NULL,
  `employeeID` int(11) NOT NULL,
  `shippingMethodID` int(11) NOT NULL,
  `totalAmount` double NOT NULL,
  `amountPaid` decimal(10,0) NOT NULL,
  `totalTaxAmount` double NOT NULL,
  `totalPayable` double NOT NULL,
  `total` 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` smallint(16) NOT NULL,
  `updateAble` tinyint(1) NOT NULL DEFAULT '1',
  `journalNo` varchar(32) NOT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=209 ;

--
-- Dumping data for table `comp_supplier_invoice`
--

INSERT INTO `comp_supplier_invoice` (`ID`, `serialNo`, `companyID`, `purchaseInvoiceCodeID`, `purchaserID`, `supplierID`, `formNo`, `invoiceDate`, `supplierInvoiceNo`, `projectID`, `termsID`, `shipToID`, `locationID`, `currencyID`, `exchangeRate`, `agentID`, `memo`, `employeeID`, `shippingMethodID`, `totalAmount`, `amountPaid`, `totalTaxAmount`, `totalPayable`, `total`, `createdBy`, `createdTS`, `updatedBy`, `updatedTS`, `is_delete`, `updateAble`, `journalNo`) VALUES
(71, 1, 1, 1, 0, 1, 'PI2014 - invoice', '2013-04-22', 'apr 2013', 2, 7, 1, 1, 1, 1, 0, '', 0, 0, 0, '301', 0, -301, 0, 0, '2014-05-22 03:06:36', 0, '2014-06-17 10:20:43', 0, 1, ''),
(72, 1, 1, 1, 0, 1, 'PI2014nasi goreng', '2013-05-22', 'may 2013', 1, 5, 1, 1, 1, 1, 0, '', 0, 0, 0, '2', 0, -2, 0, 0, '2014-05-22 03:09:47', 0, '2014-06-17 10:20:49', 0, 1, ''),
(73, 1, 1, 2, 0, 1, 'sds', '2013-06-22', 'jun 2013', 2, 5, 1, 1, 1, 1, 0, '', 0, 0, 0, '2', 0, -2, 0, 0, '2014-05-22 03:23:12', 0, '2014-06-17 10:23:17', 0, 1, ''),
(74, 1, 1, 2, 0, 20, 'PI2tr14nasi goreng', '2013-07-22', 'jul 2013', 2, 6, 1, 1, 1, 1, 0, '', 0, 0, 0, '22', 0, -22, 0, 0, '2014-05-22 03:31:55', 0, '2014-06-17 10:23:19', 0, 1, ''),
(75, 1, 1, 2, 0, 1, 'A', '2013-08-22', 'aug 2013', 1, 6, 1, 1, 1, 1, 0, '', 0, 0, 0, '2', 0, -2, 0, 0, '2014-05-22 03:42:36', 0, '2014-06-17 10:23:20', 0, 1, ''),
(76, 1, 1, 2, 0, 20, 'PI2014nasi goreng', '2013-09-22', 'sept 2013', 1, 5, 1, 1, 1, 1, 0, '', 0, 0, 0, '122', 0, -122, 0, 0, '2014-05-22 03:51:54', 0, '2014-07-09 07:39:42', 0, 1, ''),
(77, 1, 1, 2, 0, 1, 'PI2014nasi goreng', '2013-10-22', 'oct 2013', 1, 5, 1, 1, 1, 1, 0, '', 0, 0, 0, '2', 0, -2, 0, 0, '2014-05-22 03:58:24', 0, '2014-06-17 10:23:21', 0, 1, ''),
(78, 1, 1, 2, 0, 1, 'df', '2013-11-22', 'nov 2013', 1, 5, 1, 0, 1, 1, 0, '', 0, 0, 0, '14', 0, -14, 0, 0, '2014-05-22 04:01:44', 0, '2014-07-09 07:43:06', 0, 1, ''),
(79, 1, 1, 2, 0, 1, 'PI2014nasi goreng', '2013-12-22', 'dec 2013', 1, 5, 1, 0, 1, 1, 0, '', 0, 0, 0, '2', 0, -2, 0, 0, '2014-05-22 04:15:09', 0, '2014-06-17 10:23:22', 0, 1, ''),
(80, 1, 1, 2, 0, 1, 'PI2014nasi goreng', '2014-01-22', ' jan 2014.', 2, 6, 1, 2, 1, 1, 0, '', 0, 0, 0, '5', 0, -4, 0, 0, '2014-05-22 11:17:23', 0, '2014-06-17 10:23:23', 0, 1, ''),
(81, 1, 1, 2, 0, 1, 'as', '2014-02-13', 'feb 2014', 1, 5, 1, 1, 1, 1, 0, '', 0, 0, 0, '5', 0, -4, 0, 0, '2014-05-23 07:34:21', 0, '2014-06-17 10:23:24', 0, 1, ''),
(82, 1, 1, 2, 0, 1, 'PI2014-82', '2014-03-07', 'mac 2014', 2, 5, 1, 1, 1, 1, 0, 'xcxx', 0, 0, 100700, '677845', 0, -577145, 0, 0, '2014-05-29 01:25:00', 0, '2014-07-09 07:58:36', 0, 1, ''),
(83, 1, 1, 2, 0, 1, 'PI2014nasi goreng', '2014-04-29', 'apr 2014', 1, 5, 1, 1, 1, 1, 0, 'sdsdsd', 0, 0, 0, '17', 0, -17, 0, 0, '2014-05-29 01:27:20', 0, '2014-07-09 07:43:06', 0, 1, ''),
(84, 1, 1, 2, 7, 1, 'PI2014nasi goreng', '2014-05-29', 'fd', 1, 5, 1, 1, 1, 1, 0, 'dfsger', 0, 73, 0, '17', 30, -17, 0, 0, '2014-05-29 01:33:15', 0, '2014-07-09 07:43:06', 0, 1, ''),
(85, 1, 1, 2, 6, 1, 'PI2014nasi goreng', '2014-06-03', '006', 1, 5, 1, 1, 1, 1, 0, '', 0, 7, 0, '12', 0, -12, 0, 0, '2014-06-03 03:30:34', 0, '2014-07-09 07:43:06', 0, 1, ''),
(86, 1, 1, 2, 9, 1, 'PI2014nasi goreng', '2014-06-03', 'supplier invoice no 00000011111', 2, 5, 3, 1, 1, 1, 0, '', 0, 6, 0, '122', 0, -122, 0, 0, '2014-06-03 10:38:31', 0, '2014-07-09 07:43:06', 0, 1, ''),
(87, 1, 1, 2, 9, 1, 'PI2014', '2014-06-04', '34ssss', 2, 6, 4, 1, 1, 1, 0, '', 0, 4, 0, '12', 0, -12, 0, 0, '2014-06-04 11:06:46', 0, '2014-07-09 07:43:06', 0, 1, ''),
(88, 1, 1, 2, 7, 1, 'PI2014', '2014-06-11', 'wew', 1, 5, 2, 1, 1, 1, 0, 'sds', 0, 3, 0, '12', 0, -12, 0, 0, '2014-06-11 12:13:17', 0, '2014-07-09 07:43:06', 0, 1, ''),
(89, 1, 1, 2, 6, 1, 'PI2014', '2014-06-18', 'sd', 1, 5, 1, 1, 0, 2, 0, 'dsds', 0, 73, 0, '0', 0, 0, 0, 0, '2014-06-18 09:09:02', 0, '0000-00-00 00:00:00', 0, 1, ''),
(90, 1, 1, 2, 6, 20, 'PI2014', '2014-06-18', '.,mjl;l', 1, 5, 1, 1, 0, 1, 0, 'uiuop', 0, 5, 0, '0', 0, 0, 0, 0, '2014-06-18 09:40:46', 0, '0000-00-00 00:00:00', 0, 1, ''),
(91, 1, 1, 2, 6, 1, 'PI2014', '2014-06-18', 'da', 1, 6, 3, 1, 0, 1, 0, 'asaaa', 0, 73, 0, '0', 0, 0, 0, 0, '2014-06-18 10:11:37', 0, '0000-00-00 00:00:00', 0, 1, ''),
(92, 1, 1, 2, 7, 1, 'PI2014', '2014-06-18', 'da', 1, 5, 1, 1, 0, 1, 0, 'asa', 0, 74, 0, '0', 0, 0, 0, 0, '2014-06-18 10:27:37', 0, '0000-00-00 00:00:00', 0, 1, ''),
(93, 1, 1, 2, 7, 1, 'PI2014', '2014-06-19', 'qeq', 10, 6, 5, 1, 0, 1, 0, 'acw weqwq', 0, 73, 0, '12', 0, -12, 0, 0, '2014-06-19 01:02:31', 0, '2014-07-09 07:43:06', 0, 1, ''),
(94, 1, 1, 2, 7, 1, 'PI2014', '2014-06-19', 'qwq', 16, 7, 1, 1, 0, 1, 0, 'adwe', 0, 5, 0, '0', 0, 0, 0, 0, '2014-06-19 01:09:11', 0, '0000-00-00 00:00:00', 0, 1, ''),
(95, 1, 1, 2, 7, 1, 'PI2014', '2014-06-19', 'asq', 1, 5, 1, 1, 0, 1, 0, 'sdq', 0, 73, 0, '26', 0, -26, 0, 0, '2014-06-19 01:27:02', 0, '2014-07-09 08:09:46', 0, 1, ''),
(96, 1, 1, 2, 6, 1, 'PI2014', '2014-06-19', 'wqw', 1, 5, 1, 1, 0, 1, 0, 'weqwq', 0, 5, 0, '122', 0, -122, 0, 0, '2014-06-19 01:37:31', 0, '2014-07-09 08:12:23', 0, 1, ''),
(97, 1, 1, 2, 7, 1, 'PI2014', '2014-06-19', 'dwe', 10, 5, 1, 1, 0, 1, 0, '21da', 0, 74, 3.18, '12', 0.18, -8.82, 0, 0, '2014-06-19 01:59:53', 16, '2014-07-09 08:12:23', 0, 1, ''),
(98, 1, 1, 2, 7, 1, 'PI2014', '2014-06-20', '90', 1, 5, 3, 1, 0, 1, 0, 'kjl;', 0, 6, 0, '12', 0, -12, 0, 0, '2014-06-20 09:36:39', 0, '2014-07-09 08:12:23', 0, 1, ''),
(99, 1, 1, 2, 6, 1, 'PI2014', '2014-06-23', 'jklk', 16, 6, 1, 1, 0, 1, 0, 'lkl', 0, 5, 0, '0', 0, 0, 0, 0, '2014-06-23 03:21:52', 0, '0000-00-00 00:00:00', 0, 1, ''),
(100, 1, 1, 2, 7, 1, 'PI2014[00000001]', '2014-08-13', '234234', 1, 6, 0, 1, 0, 0, 0, '', 0, 73, 0, '121', 0, -121, 0, 16, '2014-06-24 08:19:17', 16, '2014-08-13 07:16:22', 0, 1, ''),
(101, 1, 1, 2, 7, 1, 'PI2014', '2014-06-26', 'kl09887', 1, 5, 2, 1, 0, 1, 0, '', 0, 5, 0, '1213', 0, -1213, 0, 16, '2014-06-26 06:44:47', 16, '2014-07-11 01:00:50', 0, 1, ''),
(102, 1, 15, 2, 12, 26, 'PI2014', '2014-07-01', 'sup inv 321', 19, 5, 1, 3, 0, 1, 0, '', 0, 5, 0, '0', 0, 0, 0, 16, '2014-07-01 05:04:07', 16, '2014-07-16 00:09:19', 0, 0, 'AP20140200000001'),
(103, 1, 1, 2, 7, 1, 'PI2014', '2014-07-04', 'as', 1, 5, 1, 1, 0, 1, 0, 'sdsd', 0, 74, 0, '131', 0, -1, 0, 16, '2014-07-04 00:14:51', 16, '2014-07-11 01:00:02', 0, 0, 'AP20140700000001'),
(104, 1, 1, 2, 6, 1, 'PI2014', '2014-05-26', '2452354', 1, 5, 1, 0, 0, 1, 0, 'dfa dfasfd ', 0, 3, 1555.02, '1698', 0, -142.98000000000002, 0, 16, '2014-07-07 02:45:16', 16, '2014-07-21 06:43:10', 0, 1, ''),
(105, 1, 1, 2, 6, 1, 'PI2014', '2014-05-26', '24', 1, 5, 1, 0, 0, 1, 0, 'we rtwe r', 0, 6, 0, '0', 0, 0, 0, 16, '2014-07-07 02:46:54', 0, '0000-00-00 00:00:00', 0, 1, ''),
(106, 1, 1, 2, 6, 1, 'PI2014', '2014-05-26', '345234', 1, 5, 1, 0, 0, 1, 0, 'afsdasdf asdf asfd', 0, 3, 0, '0', 0, 0, 0, 16, '2014-07-07 03:44:54', 0, '0000-00-00 00:00:00', 0, 1, ''),
(107, 1, 1, 2, 6, 1, 'PI2014', '2014-05-26', '345234', 1, 5, 1, 0, 0, 1, 0, 'afsdasdf asdf asfd', 0, 3, 0, '0', 0, 0, 0, 16, '2014-07-07 03:45:03', 0, '0000-00-00 00:00:00', 0, 1, ''),
(108, 1, 1, 2, 6, 1, 'PI2014', '2014-05-26', '0', 17, 5, 1, 0, 0, 1, 0, 'zcsdfas', 0, 74, 0, '0', 0, 0, 0, 16, '2014-07-07 03:47:27', 0, '0000-00-00 00:00:00', 0, 1, ''),
(109, 1, 1, 2, 6, 1, 'PI2014', '2014-05-26', '342', 1, 5, 1, 0, 0, 1, 0, '', 0, 74, 0, '0', 0, 0, 0, 16, '2014-07-07 03:48:51', 0, '0000-00-00 00:00:00', 0, 1, ''),
(112, 1, 1, 1, 6, 1, 'PI2014', '2014-05-26', '0', 10, 5, 1, 1, 0, 1, 0, 'WAE DADFSDF ASDFASFD ', 6, 74, 345, '741', 20.7, -396, 0, 16, '2014-07-07 04:59:30', 0, '2014-07-21 06:43:10', 0, 1, ''),
(113, 1, 1, 1, 6, 1, 'PI2014', '2014-05-26', '0', 10, 5, 1, 1, 0, 1, 0, 'WAE DADFSDF ASDFASFD ', 6, 74, 345, '345', 20.7, 0, 0, 16, '2014-07-07 05:01:40', 0, '2014-07-21 07:16:07', 0, 1, ''),
(114, 1, 1, 1, 6, 1, 'PI2014', '2014-05-26', '0', 10, 5, 1, 1, 0, 1, 0, 'WAE DADFSDF ASDFASFD ', 6, 74, 0, '366', 0, -366, 0, 16, '2014-07-07 05:03:39', 0, '2014-07-21 07:01:40', 0, 1, ''),
(115, 1, 1, 1, 6, 1, 'PI2014', '2014-05-26', '0', 1, 5, 1, 1, 0, 1, 0, '', 6, 5, 345, '366', 20.7, -21, 0, 16, '2014-07-07 05:05:18', 0, '2014-07-21 07:01:40', 0, 1, ''),
(116, 1, 1, 1, 6, 1, 'PI2014', '2014-05-26', '0', 1, 5, 1, 1, 0, 1, 0, '', 6, 5, 345, '366', 20.7, -21, 0, 16, '2014-07-07 05:07:02', 0, '2014-07-21 07:01:40', 0, 1, ''),
(117, 1, 1, 1, 6, 1, 'PI2014', '2014-05-26', '0', 1, 5, 1, 1, 0, 1, 0, '', 6, 74, 345, '366', 20.7, -21, 0, 16, '2014-07-07 05:09:32', 0, '2014-07-21 07:16:07', 0, 1, ''),
(118, 1, 1, 1, 6, 1, 'PI2014', '2014-05-26', '0', 1, 5, 1, 1, 0, 1, 0, '', 6, 74, 345, '0', 20.7, 365.7, 0, 16, '2014-07-07 05:10:16', 0, '2014-07-09 07:26:57', 0, 1, ''),
(119, 1, 1, 1, 6, 1, 'PI2014', '2014-05-26', '0', 1, 5, 1, 1, 0, 1, 0, '', 6, 74, 345, '0', 20.7, 365.7, 0, 16, '2014-07-07 05:10:31', 0, '2014-07-09 07:26:57', 0, 1, ''),
(120, 1, 1, 1, 6, 1, 'PI2014', '2014-05-26', '0', 1, 5, 1, 1, 0, 1, 0, '', 6, 74, 345, '366', 20.7, -21, 0, 16, '2014-07-07 05:10:48', 0, '2014-07-21 07:09:30', 0, 1, ''),
(121, 1, 1, 1, 6, 1, 'PI2014', '2014-05-26', '0', 10, 5, 1, 1, 0, 1, 0, 'qwefqwerwqr', 6, 73, 456, '483', 27.36, -27, 0, 16, '2014-07-07 05:13:10', 0, '2014-07-21 07:07:36', 0, 1, ''),
(122, 1, 1, 1, 6, 1, 'PI2014', '2014-05-26', '0', 10, 5, 1, 1, 0, 1, 0, 'qwefqwerwqr', 6, 73, 456, '483', 27.36, -27, 0, 16, '2014-07-07 05:13:53', 0, '2014-07-21 07:07:36', 0, 1, ''),
(123, 1, 1, 1, 6, 1, 'PI2014', '2014-05-26', '0', 1, 5, 1, 1, 0, 1, 0, '', 6, 6, 345, '366', 20.7, -21, 0, 16, '2014-07-07 05:15:55', 0, '2014-07-21 07:07:36', 0, 1, ''),
(124, 1, 1, 1, 6, 1, 'PI2014', '2014-05-26', 'fghdfhg7464356', 10, 5, 1, 1, 0, 1, 0, '', 6, 6, 345, '366', 20.7, -21, 0, 16, '2014-07-07 05:21:03', 0, '2014-07-21 07:05:51', 0, 1, ''),
(125, 1, 1, 1, 6, 1, 'PI2014', '2014-05-26', 'fghdfhg7464356', 10, 5, 1, 1, 0, 1, 0, '', 6, 6, 345, '366', 20.7, -21, 0, 16, '2014-07-07 05:23:41', 0, '2014-07-21 07:05:51', 0, 1, ''),
(126, 1, 1, 1, 6, 1, 'PI2014', '2014-05-26', 'fghdfhg7464356', 10, 5, 1, 1, 0, 1, 0, '', 6, 6, 345, '366', 20.7, -21, 0, 16, '2014-07-07 05:24:45', 0, '2014-07-21 07:05:51', 0, 1, ''),
(127, 1, 1, 1, 6, 1, 'PI2014', '2014-05-26', 'fghdfhg7464356', 10, 5, 1, 1, 0, 1, 0, '', 6, 6, 345, '837', 0, -492, 0, 16, '2014-07-07 05:39:00', 16, '2014-07-21 07:03:50', 0, 1, ''),
(128, 1, 1, 1, 6, 1, 'PI2014', '2014-06-19', 'ert3453', 1, 6, 1, 1, 0, 1, 0, 'qw', 6, 73, 456, '483', 27.36, -27, 0, 16, '2014-07-07 05:43:02', 0, '2014-07-21 07:03:50', 0, 1, ''),
(129, 1, 1, 1, 6, 1, 'PI2014', '2014-06-19', 'ert3453', 1, 6, 1, 1, 0, 1, 0, 'qw', 6, 73, 456, '483', 27.36, -27, 0, 16, '2014-07-07 05:43:24', 0, '2014-07-21 07:03:50', 0, 1, ''),
(130, 1, 1, 1, 6, 1, 'PI2014', '2014-06-19', 'ert3453', 1, 6, 1, 1, 0, 1, 0, 'qw', 6, 73, 456, '483', 27.36, -27, 0, 16, '2014-07-07 05:43:34', 0, '2014-07-21 07:03:50', 0, 1, ''),
(131, 1, 1, 1, 6, 1, 'PI2014', '2014-06-19', 'sdfg356345', 1, 5, 1, 1, 0, 1, 0, 'qw', 6, 5, 345, '345', 0, 0, 0, 16, '2014-07-07 05:46:41', 16, '2014-07-21 07:03:50', 0, 1, ''),
(132, 1, 1, 2, 7, 1, 'PI2014', '2014-07-07', '326523', 1, 5, 1, 0, 0, 1, 0, 'efgsdfg', 0, 4, 0, '0', 0, 0, 0, 16, '2014-07-07 05:51:45', 0, '0000-00-00 00:00:00', 0, 1, ''),
(133, 1, 1, 2, 7, 1, 'PI2014', '2014-07-07', '326523', 1, 5, 1, 0, 0, 1, 0, 'efgsdfg', 0, 4, 0, '0', 0, 0, 0, 16, '2014-07-07 05:51:55', 0, '0000-00-00 00:00:00', 0, 1, ''),
(134, 1, 1, 2, 7, 1, 'PI2014', '2014-07-07', 'wetwert326523', 1, 5, 1, 1, 0, 1, 0, 'efgsdfg', 0, 4, 0, '0', 0, 0, 0, 16, '2014-07-07 05:52:17', 16, '2014-07-07 05:52:18', 0, 1, ''),
(135, 1, 1, 1, 7, 1, 'PI2014', '2014-06-20', 'xfgsd35365', 10, 5, 1, 1, 0, 1, 0, 'ASA', 7, 73, 4356, '28', 0, 4328, 0, 16, '2014-07-07 05:57:08', 16, '2014-07-31 03:25:10', 0, 1, ''),
(136, 1, 1, 1, 6, 1, 'PI2014', '2014-05-26', 'sf3535634', 1, 6, 2, 1, 0, 1, 0, 'fsgdsfg', 6, 5, 567, '567', 34.02, 0, 0, 16, '2014-07-07 05:59:07', 0, '2014-07-21 07:03:50', 0, 1, ''),
(137, 1, 1, 1, 6, 1, 'PI2014', '2014-05-26', 'sf3535634', 1, 6, 2, 1, 0, 1, 0, 'fsgdsfg', 6, 5, 567, '567', 34.02, 0, 0, 16, '2014-07-07 05:59:38', 0, '2014-07-21 07:05:51', 0, 1, ''),
(138, 1, 1, 1, 7, 1, 'PI2014', '2014-05-26', 'sf3535634', 1, 6, 2, 1, 0, 1, 0, 'asa', 7, 5, 567, '567', 0, 0, 0, 16, '2014-07-07 06:00:01', 16, '2014-07-21 07:05:51', 0, 1, ''),
(139, 1, 1, 1, 6, 1, 'PI2014', '2014-06-19', 'dafd2345234', 1, 5, 1, 1, 0, 1, 0, 'qw', 6, 3, 0, '0', 0, 0, 0, 16, '2014-07-07 06:17:13', 0, '0000-00-00 00:00:00', 0, 1, ''),
(140, 1, 1, 1, 6, 1, 'PI2014', '2014-06-19', 'dafd2345234', 1, 5, 1, 1, 0, 1, 0, 'qw', 6, 3, 0, '0', 0, 0, 0, 16, '2014-07-07 06:17:37', 0, '0000-00-00 00:00:00', 0, 1, ''),
(141, 1, 1, 1, 6, 1, 'PI2014', '2014-06-19', 'dafd2345234', 1, 5, 1, 1, 0, 1, 0, 'qw', 6, 3, 0, '0', 0, 0, 0, 16, '2014-07-07 06:17:43', 0, '0000-00-00 00:00:00', 0, 1, ''),
(142, 1, 1, 1, 6, 1, 'PI2014', '2014-06-19', 'zsfsf324523', 1, 5, 1, 1, 0, 1, 0, 'qw', 6, 74, 0, '0', 0, 0, 0, 16, '2014-07-07 06:20:29', 0, '0000-00-00 00:00:00', 0, 1, ''),
(143, 1, 1, 1, 6, 1, 'PI2014', '2014-06-19', 'zsfsf324523', 1, 5, 1, 1, 0, 1, 0, 'qw', 6, 74, 0, '0', 0, 0, 0, 16, '2014-07-07 06:20:40', 0, '0000-00-00 00:00:00', 0, 1, ''),
(144, 1, 1, 1, 6, 1, 'PI2014', '2014-06-19', 'zsfsf324523', 1, 5, 1, 1, 0, 1, 0, 'qw', 6, 74, 0, '0', 0, 0, 0, 16, '2014-07-07 06:21:36', 0, '0000-00-00 00:00:00', 0, 1, ''),
(145, 1, 1, 1, 6, 1, 'PI2014', '2014-06-19', 'dfgd345634', 1, 5, 2, 1, 0, 1, 0, 'qw', 6, 3, 0, '0', 0, 0, 0, 16, '2014-07-07 06:22:37', 0, '0000-00-00 00:00:00', 0, 1, ''),
(146, 1, 1, 1, 7, 20, 'PI2014', '2014-05-26', 'sdfgsd3456346', 17, 7, 2, 1, 0, 1, 0, 'sdsd', 7, 74, 0, '0', 0, 0, 0, 16, '2014-07-07 06:27:14', 0, '0000-00-00 00:00:00', 0, 1, ''),
(147, 1, 1, 1, 7, 20, 'PI2014', '2014-05-26', 'sdfgsd3456346', 17, 7, 2, 1, 0, 1, 0, 'sdsd', 7, 74, 0, '0', 0, 0, 0, 16, '2014-07-07 06:28:19', 0, '0000-00-00 00:00:00', 0, 1, ''),
(148, 1, 1, 1, 7, 1, 'PI2014', '2014-06-12', 'asdfasfd23452354', 1, 5, 2, 1, 0, 1, 0, 'ww', 7, 74, 0, '0', 0, 0, 0, 16, '2014-07-07 06:48:23', 0, '0000-00-00 00:00:00', 0, 1, ''),
(149, 1, 1, 1, 7, 20, 'PI2014', '2014-06-02', 'dfsagf2353', 1, 5, 1, 1, 0, 1, 0, '', 7, 74, 0, '0', 0, 0, 0, 16, '2014-07-07 06:49:31', 0, '0000-00-00 00:00:00', 0, 1, ''),
(155, 1, 1, 2, 7, 23, 'PI20143', '2014-07-09', '326523', 1, 5, 4, 2, 0, 1, 0, 'efgsdfg lorem ipsum', 0, 74, 638.12, '0', 36.120000000000005, 2496.4, 0, 16, '2014-07-07 05:51:45', 16, '2014-07-11 02:19:15', 0, 1, ''),
(156, 1, 1, 2, 7, 1, 'PI2014', '2014-07-07', '326523', 1, 5, 1, 0, 0, 1, 0, 'efgsdfg', 0, 4, 0, '0', 0, 0, 0, 16, '2014-07-07 05:51:55', 0, '0000-00-00 00:00:00', 0, 1, ''),
(157, 1, 1, 1, 6, 1, 'PI2014', '2014-05-26', 'zdafdsf234243', 2, 6, 1, 1, 0, 1, 0, 'ascadfasd', 6, 74, 0, '0', 0, 0, 0, 16, '2014-07-10 03:56:24', 0, '0000-00-00 00:00:00', 0, 1, ''),
(158, 1, 1, 2, 7, 23, 'PI20143', '2014-07-09', '326523', 1, 5, 4, 2, 0, 1, 0, 'efgsdfg lorem ipsum', 0, 74, 638.12, '0', 36.120000000000005, 2496.4, 0, 16, '2014-07-07 05:51:45', 16, '2014-07-11 02:19:15', 0, 1, ''),
(159, 1, 1, 2, 6, 1, 'PI2014', '2014-07-11', 'sds', 15, 5, 1, 1, 0, 1, 0, 'sdsfdw', 0, 5, 0, '0', 0, 0, 0, 16, '2014-07-11 04:12:34', 0, '0000-00-00 00:00:00', 0, 1, ''),
(160, 1, 1, 2, 6, 1, 'PI2014', '2014-07-11', 'sds', 15, 5, 1, 1, 0, 1, 0, 'sdsfdw', 0, 5, 40.28, '0', 2.2800000000000002, 0, 0, 16, '2014-07-11 04:17:30', 0, '2014-07-11 04:40:12', 0, 1, ''),
(161, 1, 1, 2, 7, 1, 'PI2014', '2014-07-11', 's', 1, 5, 1, 1, 0, 1, 0, 'w', 0, 5, 0, '0', 0, 0, 0, 16, '2014-07-11 06:49:35', 0, '0000-00-00 00:00:00', 0, 1, ''),
(162, 1, 1, 2, 6, 1, 'PI2014', '2014-07-11', 'ytr', 1, 5, 1, 1, 0, 1, 0, 'd', 0, 8, 2251.28, '0', 127.28, 0, 0, 16, '2014-07-11 07:16:54', 0, '2014-07-11 07:30:33', 0, 1, ''),
(163, 1, 1, 1, 6, 1, 'PI2014', '2014-05-13', 'afsfgsd3453', 1, 5, 1, 1, 0, 1, 0, '', 6, 73, 567, '601', 34.02, -34, 0, 16, '2014-07-14 03:38:17', 0, '2014-07-21 07:03:50', 0, 1, ''),
(164, 1, 1, 1, 6, 1, 'PI2014', '2014-05-13', 'asdfa42354', 2, 7, 1, 1, 0, 3.25, 0, 'rw wert wert wet', 6, 74, 0, '0', 0, 0, 0, 16, '2014-07-14 03:42:58', 0, '0000-00-00 00:00:00', 0, 1, ''),
(165, 1, 1, 1, 6, 1, 'PI2014', '2014-05-14', 'asdf23452', 15, 6, 1, 1, 0, 1, 0, 'sdfasfdsafd', 6, 74, 0, '0', 0, 0, 0, 16, '2014-07-14 04:04:10', 0, '0000-00-00 00:00:00', 0, 1, ''),
(166, 1, 1, 1, 6, 1, 'PI2014', '2014-05-12', 'dfasd2454', 2, 5, 1, 1, 0, 1, 0, '', 6, 74, 0, '12', 0, -12, 0, 16, '2014-07-14 04:16:04', 0, '2014-07-21 07:03:50', 0, 1, ''),
(167, 1, 1, 1, 6, 1, 'PI2014', '2014-05-12', 'adfasd45', 15, 6, 1, 1, 0, 1, 0, '', 6, 5, 12, '12', 0, 0, 0, 16, '2014-07-14 04:19:01', 0, '2014-07-21 07:03:50', 0, 1, ''),
(168, 1, 1, 1, 6, 1, 'PI2014', '2014-05-12', 'adasdf45345', 2, 6, 1, 1, 0, 1, 0, '', 6, 74, 12, '12', 0, 0, 0, 16, '2014-07-14 04:26:29', 0, '2014-07-21 07:03:50', 0, 1, ''),
(169, 1, 1, 1, 6, 1, 'PI2014', '2014-05-12', 'adasdf45345', 2, 6, 1, 1, 0, 1, 0, '', 6, 74, 12, '12', 0, 0, 0, 16, '2014-07-14 04:29:17', 0, '2014-07-21 07:03:50', 0, 1, ''),
(170, 1, 1, 1, 6, 1, 'PI2014', '2014-05-12', 'dfadf24523', 1, 6, 1, 1, 0, 1, 0, '', 6, 73, 260.76, '261', 0, -0.2400000000000091, 0, 16, '2014-07-14 04:50:57', 16, '2014-07-21 07:02:44', 0, 1, ''),
(171, 1, 1, 1, 6, 1, 'PI2014', '2014-05-12', 'aDFASF243523', 1, 5, 1, 1, 0, 1, 0, '', 6, 73, 12, '12', 0, 0, 0, 16, '2014-07-14 04:57:32', 0, '2014-07-21 07:02:44', 0, 1, ''),
(172, 1, 1, 1, 6, 1, 'PI2014', '2014-05-12', 'asdf2345', 2, 6, 1, 1, 0, 1, 0, '', 6, 73, 4937.4800000000005, '20', 0, 4917.4800000000005, 0, 16, '2014-07-14 04:59:15', 16, '2014-07-21 07:09:30', 0, 1, ''),
(173, 1, 1, 1, 6, 1, 'PI2014', '2014-05-12', 'asgf3w4523', 10, 5, 2, 1, 0, 1, 0, '', 6, 74, 483.36, '849', 0, -365.64, 0, 16, '2014-07-14 05:05:32', 16, '2014-07-21 07:02:44', 0, 1, ''),
(174, 1, 1, 1, 6, 1, 'PI2014', '2014-05-12', 'qwdqe42341234', 10, 6, 1, 1, 0, 1, 0, '', 6, 74, 367, '389', 22.02, -22, 0, 16, '2014-07-14 05:06:55', 0, '2014-07-21 07:02:44', 0, 1, ''),
(175, 1, 1, 1, 6, 1, 'PI2014', '2014-05-12', 'qwdqe42341234', 10, 6, 1, 1, 0, 1, 0, '', 6, 74, 367, '389', 22.02, -22, 0, 16, '2014-07-14 05:12:39', 0, '2014-07-21 07:02:44', 0, 1, ''),
(176, 1, 1, 1, 6, 1, 'PI2014', '2014-05-13', 'zfgst35325', 1, 5, 1, 1, 0, 1, 0, '', 6, 73, 588, '623', 35.28, -35, 0, 16, '2014-07-14 05:15:49', 0, '2014-07-21 07:02:44', 0, 1, ''),
(177, 1, 1, 1, 6, 1, 'PI2014', '2014-05-14', 'asdf2345', 10, 5, 1, 1, 0, 1, 0, '', 6, 74, 0, '625', 590, -625, 0, 16, '2014-07-14 05:21:47', 0, '2014-07-21 07:02:44', 0, 1, ''),
(178, 1, 1, 1, 6, 1, 'PI2014', '2014-05-29', 'asfg2356236', 1, 7, 2, 1, 0, 1, 0, '', 6, 74, 0, '70', 67, -70, 0, 16, '2014-07-14 05:27:13', 0, '2014-07-21 07:02:44', 0, 1, ''),
(179, 1, 1, 1, 6, 1, 'PI2014', '2014-05-29', 'dafs23532', 1, 5, 1, 1, 0, 1, 0, '', 6, 73, 0, '24', 0, -24, 0, 16, '2014-07-14 05:31:07', 16, '2014-07-21 07:02:44', 0, 1, ''),
(180, 1, 1, 1, 6, 20, 'PI2014', '2014-06-24', 'zdafdsf234243', 10, 6, 1, 1, 0, 1, 0, '', 6, 73, 71.7, '0', 0, 71.7, 0, 16, '2014-07-14 05:55:13', 16, '2014-07-14 05:55:30', 0, 1, ''),
(181, 1, 1, 1, 6, 1, 'PI2014', '2014-05-28', 'asfgasfa453', 10, 5, 1, 1, 0, 1, 0, 'asf', 6, 74, 71.36, '71', 0, 0.35999999999999943, 0, 16, '2014-07-14 05:58:24', 16, '2014-07-21 07:02:45', 0, 1, ''),
(182, 1, 15, 1, 12, 26, 'PI2014', '2014-07-16', 'awan biru 1', 19, 5, 1, 3, 0, 3.8, 0, '', 12, 7, 664.5, '0', 37.5, 664.5, 0, 16, '2014-07-16 00:27:26', 0, '2014-07-16 02:05:45', 0, 0, 'AP20140200000002'),
(183, 1, 15, 1, 9, 26, 'PI2014', '2014-07-16', 'awan biru 2', 19, 5, 2, 4, 0, 1, 0, '', 9, 5, 21.2, '0', 1.2, 21.2, 0, 16, '2014-07-16 00:35:38', 0, '2014-07-16 02:12:52', 0, 0, 'AP20140200000003'),
(184, 1, 1, 1, 6, 1, 'PI2014', '2014-07-16', 'qwfd245', 10, 5, 1, 1, 0, 1, 0, '', 6, 73, 22, '23', 0.66, -1, 0, 16, '2014-07-16 01:04:15', 0, '2014-07-21 07:02:45', 0, 1, ''),
(185, 1, 15, 1, 9, 26, 'PI2014', '2014-07-16', 'awan biru 3', 19, 5, 1, 3, 0, 1, 0, '', 9, 5, 15.9, '0', 0.9, 15.9, 0, 16, '2014-07-16 01:14:00', 0, '2014-07-16 02:05:45', 0, 1, ''),
(186, 1, 1, 1, 6, 1, 'PI2014', '2014-07-16', 'sfg2342', 1, 6, 1, 1, 0, 1, 0, '', 6, 74, 13, '13', 0.06, 0, 0, 16, '2014-07-16 01:22:33', 0, '2014-07-21 07:02:45', 0, 1, ''),
(187, 1, 1, 1, 6, 1, 'PI2014', '2014-07-16', 'sdfg356', 1, 5, 1, 1, 0, 1, 0, '', 6, 4, 11, '11', 0, 0, 0, 16, '2014-07-16 01:23:41', 0, '2014-07-21 07:02:45', 0, 1, ''),
(188, 1, 1, 1, 6, 1, 'PI2014', '2014-07-16', 'sfg356', 15, 6, 1, 1, 0, 1, 0, '', 6, 3, 23, '24', 0.66, -1, 0, 16, '2014-07-16 01:24:56', 0, '2014-07-21 07:02:45', 0, 1, ''),
(189, 1, 1, 1, 6, 1, 'PI2014', '2014-07-16', 'sdfg3653', 1, 5, 1, 1, 0, 1, 0, '', 6, 73, 11, '12', 0.66, -1, 0, 16, '2014-07-16 01:29:14', 0, '2014-07-21 07:02:45', 0, 1, ''),
(190, 1, 1, 1, 6, 1, 'PI2014', '2014-07-16', 'zdafdsf234243', 2, 5, 1, 1, 0, 1, 0, '', 6, 6, 23.66, '24', 0.66, -0.33999999999999986, 0, 16, '2014-07-16 01:43:57', 0, '2014-07-21 07:02:45', 0, 1, ''),
(191, 1, 15, 1, 9, 26, 'PI2014', '2014-07-16', 'awan biru 4', 19, 5, 2, 5, 0, 1, 0, '', 9, 5, 2368.04, '0', 134.04, 2368.04, 0, 16, '2014-07-16 02:10:14', 0, '2014-07-16 02:10:18', 0, 1, ''),
(192, 1, 1, 1, 6, 1, 'PI2014', '2014-07-16', 'sdf45345', 1, 5, 1, 1, 0, 1, 0, '', 6, 74, 1476, '6', 0, 1470, 0, 16, '2014-07-16 02:11:05', 0, '2014-07-21 07:16:07', 0, 1, ''),
(193, 1, 15, 1, 12, 26, 'PI2014', '2014-07-16', 'l;,;k;l12', 19, 5, 1, 3, 0, 1, 0, '', 12, 74, 42395.76, '0', 2399.76, 42395.76, 0, 16, '2014-07-16 02:11:51', 0, '0000-00-00 00:00:00', 0, 1, ''),
(194, 1, 1, 1, 6, 1, 'PI2014', '2014-05-29', 'adfas2452354', 1, 5, 1, 1, 0, 1, 0, '', 6, 74, 70.76, '71', 2.76, -0.23999999999999488, 0, 16, '2014-07-17 00:33:33', 16, '2014-07-21 07:02:45', 0, 1, ''),
(195, 1, 1, 1, 6, 1, 'PI2014', '2014-07-17', 'asdf2345', 1, 5, 1, 1, 0, 1, 0, '', 6, 74, 70.36, '70', 3.36, 0.35999999999999943, 0, 16, '2014-07-17 00:35:51', 16, '2014-07-21 07:02:45', 0, 1, ''),
(196, 1, 1, 1, 6, 1, 'PI2014', '2014-07-17', 'asdfsafd54', 1, 5, 1, 1, 0, 1, 0, '', 6, 74, 419.76, '420', 23.76, -0.2400000000000091, 0, 16, '2014-07-17 05:40:09', 0, '2014-07-21 07:02:45', 0, 1, ''),
(197, 1, 81, 1, 21, 32, 'PI', '2014-07-21', '001', 22, 17, 1, 9, 0, 1, 0, '', 21, 6, 0, '0', 0, 0, 0, 29, '2014-07-21 04:50:46', 0, '2014-07-21 07:47:58', 0, 0, ''),
(198, 1, 81, 1, 21, 32, 'PI', '2014-07-21', '001copy', 22, 17, 1, 9, 0, 1, 0, '', 21, 6, 0, '0', 0, 0, 0, 29, '2014-07-21 04:50:46', 0, '2014-07-21 06:00:16', 0, 1, ''),
(199, 1, 81, 2, 21, 32, 'PI', '2014-07-21', '001', 22, 17, 1, 9, 0, 1, 0, '', 0, 6, 1166, '0', 66, 0, 0, 29, '2014-07-21 07:29:28', 0, '2014-07-21 07:29:28', 0, 1, ''),
(200, 1, 1, 1, 6, 31, 'PI2014', '2014-07-24', '003', 24, 17, 9, 1, 0, 1, 0, 'testset', 6, 73, 63.6, '0', 3.6, 63.6, 0, 1, '2014-07-24 03:55:05', 0, '0000-00-00 00:00:00', 0, 1, ''),
(201, 1, 1, 1, 6, 31, 'PI2014', '2014-07-24', '003', 24, 17, 9, 1, 0, 1, 0, 'testset', 6, 73, 63.6, '0', 3.6, 63.6, 0, 1, '2014-07-24 03:55:07', 0, '0000-00-00 00:00:00', 0, 1, ''),
(202, 2, 1, 2, 7, 1, 'PI2014', '2014-06-26', 'kl09887', 1, 5, 2, 1, 0, 1, 0, '', 0, 5, 0, '1213', 0, -1213, 0, 16, '2014-06-26 06:44:47', 16, '2014-07-11 01:00:50', 0, 1, ''),
(203, 3, 1, 2, 7, 1, 'PI2014', '2014-06-26', 'kl09887', 1, 5, 2, 1, 0, 1, 0, '', 0, 5, 0, '1213', 0, -1213, 0, 16, '2014-06-26 06:44:47', 16, '2014-07-11 01:00:50', 0, 1, ''),
(204, 4, 1, 2, 7, 1, 'PI2014', '2014-06-26', 'kl09887', 1, 5, 2, 1, 0, 1, 0, '', 0, 5, 0, '1213', 0, -1213, 0, 16, '2014-06-26 06:44:47', 16, '2014-07-11 01:00:50', 0, 1, ''),
(205, 5, 1, 2, 7, 1, 'PI2014', '2014-06-26', 'kl09887', 1, 5, 2, 1, 0, 1, 0, '', 0, 5, 0, '1213', 0, -1213, 0, 16, '2014-06-26 06:44:47', 16, '2014-07-11 01:00:50', 0, 1, ''),
(206, 6, 1, 2, 7, 1, 'PI2014', '2014-06-26', 'kl09887', 1, 5, 2, 1, 0, 1, 0, '', 0, 5, 0, '1213', 0, -1213, 0, 16, '2014-06-26 06:44:47', 16, '2014-07-11 01:00:50', 0, 1, ''),
(207, 2, 81, 1, 27, 33, 'PI', '2014-08-05', '1111', 23, 17, 1, 9, 0, 1, 0, 'test', 27, 4, 670, '0', 0, 670, 0, 29, '2014-08-05 01:23:47', 0, '0000-00-00 00:00:00', 0, 1, ''),
(208, 1, 84, 1, 29, 34, 'PI20140813', '2014-08-11', 'asdfasdf1234', 26, 17, 0, 10, 0, 0, 0, 'lorem ipsum dolor sit emet', 29, 73, 0, '0', 130.38, 130.38, 0, 33, '2014-08-13 04:58:44', 0, '2014-08-13 04:58:45', 0, 1, '');

--
-- Triggers `comp_supplier_invoice`
--
DROP TRIGGER IF EXISTS `trigger_before_insert_si_add_serialNo`;
DELIMITER //
CREATE TRIGGER `trigger_before_insert_si_add_serialNo` BEFORE INSERT ON `comp_supplier_invoice`
 FOR EACH ROW set new.serialNo = (select nextSerialNo 
			   from view_serial_comp_supplier_invoice 
			   where companyID = new.companyID)
//
DELIMITER ;

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

--
-- Table structure for table `comp_supplier_invoice_charges`
--

CREATE TABLE IF NOT EXISTS `comp_supplier_invoice_charges` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `invoiceID` int(11) NOT NULL,
  `lineNo` int(11) NOT NULL,
  `accountNoID` int(11) NOT NULL,
  `chargeDescription` text NOT NULL,
  `itemname` varchar(64) NOT NULL,
  `itemdescription` text NOT NULL,
  `quantity` int(11) NOT NULL,
  `unitPrice` double NOT NULL,
  `amountExcludedTax` double NOT NULL,
  `taxID` int(11) NOT NULL,
  `taxRate` double NOT NULL,
  `taxAmount` double NOT NULL,
  `amountIncludedTax` double NOT NULL,
  `drAccountID` int(11) NOT NULL,
  `crAccountID` int(11) NOT NULL,
  `drTaxAccountID` int(11) NOT NULL,
  `crTaxAccountID` 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 '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=87 ;

--
-- Dumping data for table `comp_supplier_invoice_charges`
--

INSERT INTO `comp_supplier_invoice_charges` (`ID`, `invoiceID`, `lineNo`, `accountNoID`, `chargeDescription`, `itemname`, `itemdescription`, `quantity`, `unitPrice`, `amountExcludedTax`, `taxID`, `taxRate`, `taxAmount`, `amountIncludedTax`, `drAccountID`, `crAccountID`, `drTaxAccountID`, `crTaxAccountID`, `createdBy`, `createdTS`, `updatedBy`, `updatedTS`) VALUES
(19, 88, 1, 101, '', '', 'sds', 0, 0, 12, 1, 0, 0.72, 12.72, 0, 0, 0, 0, 0, '2014-06-11 12:13:28', 0, '2014-06-18 02:00:50'),
(20, 93, 1, 101, '', '', 'qwqwq', 0, 0, 12, 1, 0, 0.72, 12.72, 0, 0, 0, 0, 0, '2014-06-19 01:03:13', 0, '0000-00-00 00:00:00'),
(21, 93, 2, 100, '', '', '1213 weq', 0, 0, 121, 5, 0, 0, 121, 0, 0, 0, 0, 0, '2014-06-19 01:03:36', 0, '0000-00-00 00:00:00'),
(22, 95, 1, 101, '', '', 'qwq', 0, 0, 12, 1, 0, 0.72, 12.72, 0, 0, 0, 0, 0, '2014-06-19 01:28:57', 0, '0000-00-00 00:00:00'),
(23, 96, 1, 102, '', '', 'qwq', 0, 0, 12, 4, 0, 0, 12, 0, 0, 0, 0, 0, '2014-06-19 01:38:49', 0, '0000-00-00 00:00:00'),
(24, 97, 1, 101, '', '', 'gcfdzhsKL;ASKJV', 0, 0, 1, 1, 0, 0.06, 1.06, 0, 0, 0, 0, 0, '2014-06-19 02:14:49', 16, '2014-07-09 01:47:26'),
(26, 103, 0, 100, '', '', 'df desfr', 0, 0, 1, 5, 0, 0, 1, 0, 0, 0, 0, 16, '2014-07-04 01:03:16', 0, '0000-00-00 00:00:00'),
(27, 103, 1, 101, '', '', 'sdsd sd', 0, 0, 1, 1, 0, 0.06, 1.06, 0, 0, 0, 0, 16, '2014-07-04 01:05:32', 0, '0000-00-00 00:00:00'),
(28, 103, 2, 100, '', '', 'wewrw', 0, 0, 1, 3, 0, 0, 1, 0, 0, 0, 0, 16, '2014-07-04 01:10:02', 0, '0000-00-00 00:00:00'),
(29, 103, 3, 101, '', '', 'sds', 0, 0, 1, 1, 0, 0.06, 1.06, 0, 0, 0, 0, 16, '2014-07-04 01:11:22', 0, '0000-00-00 00:00:00'),
(30, 103, 4, 101, '', '', 'dfdr', 0, 0, 111, 1, 0, 6.66, 117.66, 0, 0, 0, 0, 16, '2014-07-04 01:15:11', 16, '2014-07-04 01:24:04'),
(31, 103, 5, 101, '', '', 'tgrt', 0, 0, 1, 1, 0, 0.06, 1.06, 0, 0, 0, 0, 16, '2014-07-04 01:24:21', 0, '0000-00-00 00:00:00'),
(32, 104, 1, 101, '', '', 'asdfas12341234', 0, 0, 345, 1, 0, 20.7, 365.7, 0, 0, 0, 0, 16, '2014-07-07 02:45:16', 0, '0000-00-00 00:00:00'),
(33, 105, 1, 100, '', '', 'sgf sfg s', 0, 0, 2345, 1, 0, 140.7, 2485.7, 0, 0, 0, 0, 16, '2014-07-07 02:46:54', 0, '0000-00-00 00:00:00'),
(34, 106, 1, 101, '', '', 'adfs32452354', 0, 0, 345, 1, 0, 20.7, 365.7, 0, 0, 0, 0, 16, '2014-07-07 03:44:54', 0, '0000-00-00 00:00:00'),
(35, 107, 1, 101, '', '', 'adfs32452354', 0, 0, 345, 1, 0, 20.7, 365.7, 0, 0, 0, 0, 16, '2014-07-07 03:45:03', 0, '0000-00-00 00:00:00'),
(36, 108, 1, 100, '', '', 'awer23452354', 0, 0, 4546, 1, 0, 272.76, 4818.76, 0, 0, 0, 0, 16, '2014-07-07 03:47:27', 0, '0000-00-00 00:00:00'),
(37, 109, 1, 100, '', '', 'asdf23452', 0, 0, 454, 1, 0, 27.24, 481.24, 0, 0, 0, 0, 16, '2014-07-07 03:48:51', 0, '0000-00-00 00:00:00'),
(38, 127, 1, 101, '0', '', '', 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 16, '2014-07-07 05:39:00', 0, '0000-00-00 00:00:00'),
(39, 127, 2, 102, '', '', 'asdf234234', 0, 0, 433, 1, 0, 25.98, 458.98, 0, 0, 0, 0, 16, '2014-07-07 05:40:23', 0, '0000-00-00 00:00:00'),
(40, 128, 1, 101, '0', '', '', 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 16, '2014-07-07 05:43:02', 0, '0000-00-00 00:00:00'),
(41, 129, 1, 101, '0', '', '', 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 16, '2014-07-07 05:43:24', 0, '0000-00-00 00:00:00'),
(42, 130, 1, 101, '0', '', '', 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 16, '2014-07-07 05:43:34', 0, '0000-00-00 00:00:00'),
(43, 131, 1, 101, '0', '', '', 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 16, '2014-07-07 05:46:42', 0, '0000-00-00 00:00:00'),
(44, 131, 2, 101, '', '', 'dddde455', 0, 0, 56, 1, 0, 3.36, 59.36, 0, 0, 0, 0, 16, '2014-07-07 05:49:25', 0, '0000-00-00 00:00:00'),
(45, 131, 3, 102, '', '', 'dsg345', 0, 0, 567, 1, 0, 34.02, 601.02, 0, 0, 0, 0, 16, '2014-07-07 05:49:42', 0, '0000-00-00 00:00:00'),
(46, 132, 1, 101, '', '', 'asdf asdf 243', 0, 0, 456, 1, 0, 27.36, 483.36, 0, 0, 0, 0, 16, '2014-07-07 05:51:45', 0, '0000-00-00 00:00:00'),
(47, 133, 1, 101, '', '', 'asdf asdf 243', 0, 0, 456, 1, 0, 27.36, 483.36, 0, 0, 0, 0, 16, '2014-07-07 05:51:55', 0, '0000-00-00 00:00:00'),
(48, 135, 1, 101, '0', '', '', 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 16, '2014-07-07 05:57:08', 0, '0000-00-00 00:00:00'),
(49, 135, 2, 102, '', '', 'qwer245', 0, 0, 435, 1, 0, 26.1, 461.1, 0, 0, 0, 0, 16, '2014-07-07 05:57:31', 0, '0000-00-00 00:00:00'),
(50, 136, 1, 101, '0', '', '', 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 16, '2014-07-07 05:59:07', 0, '0000-00-00 00:00:00'),
(51, 137, 1, 101, '0', '', '', 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 16, '2014-07-07 05:59:38', 0, '0000-00-00 00:00:00'),
(52, 138, 1, 101, '0', '', '', 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 16, '2014-07-07 06:00:01', 0, '0000-00-00 00:00:00'),
(53, 138, 2, 101, '', '', 'sfdg456456', 0, 0, 456, 1, 0, 27.36, 483.36, 0, 0, 0, 0, 16, '2014-07-07 06:01:35', 0, '0000-00-00 00:00:00'),
(55, 156, 1, 101, '', '', 'asdf asdf 243', 0, 0, 456, 1, 0, 27.36, 483.36, 0, 0, 0, 0, 16, '2014-07-07 05:51:55', 0, '0000-00-00 00:00:00'),
(56, 104, 2, 102, 'adfsdf2345235', '', 'adfsdf2345235', 0, 0, 456, 1, 0, 27.36, 483.36, 0, 0, 0, 0, 16, '2014-07-11 01:51:51', 16, '2014-07-11 02:14:17'),
(57, 155, 2, 101, 'sfgsfg3563456', '', 'fsdfgsd34535', 0, 0, 466, 1, 0, 27.96, 493.96, 0, 0, 0, 0, 16, '2014-07-11 01:54:12', 16, '2014-07-11 02:08:34'),
(63, 158, 2, 101, 'sfgsfg3563456', '', 'fsdfgsd34535', 0, 0, 466, 1, 0, 27.96, 493.96, 0, 0, 0, 0, 16, '2014-07-11 01:54:12', 16, '2014-07-11 02:08:34'),
(64, 160, 1, 100, 'sdda', '', '', 0, 0, 12, 10, 0, 0.72, 12.72, 0, 0, 0, 0, 16, '2014-07-11 04:39:13', 0, '0000-00-00 00:00:00'),
(65, 160, 1, 100, 'sdda', '', '', 0, 0, 12, 10, 0, 0.72, 12.72, 0, 0, 0, 0, 16, '2014-07-11 04:39:28', 0, '0000-00-00 00:00:00'),
(66, 160, 1, 100, 'sdda', '', '', 0, 0, 12, 10, 0, 0.72, 12.72, 0, 0, 0, 0, 16, '2014-07-11 04:40:12', 0, '0000-00-00 00:00:00'),
(67, 162, 1, 100, 'asa', '', '', 0, 0, 1, 5, 0, 0, 1, 0, 0, 0, 0, 16, '2014-07-11 07:21:59', 0, '0000-00-00 00:00:00'),
(68, 162, 2, 100, 'ddd', '', '', 0, 0, 2121, 10, 0, 127.26, 2248.26, 0, 0, 0, 0, 16, '2014-07-11 07:22:21', 0, '0000-00-00 00:00:00'),
(69, 163, 1, 101, '0', '', '', 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 16, '2014-07-14 03:38:17', 0, '0000-00-00 00:00:00'),
(70, 170, 1, 101, 'asdfa2435', '', '', 0, 0, 234, 1, 0, 14.04, 248.04, 0, 0, 0, 0, 16, '2014-07-14 04:51:34', 0, '0000-00-00 00:00:00'),
(71, 172, 1, 101, 'asfgs234523', '', '', 0, 0, 4646, 1, 0, 278.76, 4924.76, 0, 0, 0, 0, 16, '2014-07-14 05:02:55', 0, '0000-00-00 00:00:00'),
(72, 173, 1, 100, '0', '', '', 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 16, '2014-07-14 05:05:32', 0, '0000-00-00 00:00:00'),
(73, 173, 2, 100, 'sfg235', '', '', 0, 0, 456, 1, 0, 27.36, 483.36, 0, 0, 0, 0, 16, '2014-07-14 05:06:15', 0, '0000-00-00 00:00:00'),
(74, 174, 1, 101, '0', '', '', 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 16, '2014-07-14 05:06:55', 0, '0000-00-00 00:00:00'),
(75, 176, 1, 101, '0', '', '', 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 16, '2014-07-14 05:15:49', 0, '0000-00-00 00:00:00'),
(79, 180, 1, 101, 'asdfs345', '', '', 0, 0, 45, 1, 0, 2.7, 47.7, 0, 0, 0, 0, 16, '2014-07-14 05:55:30', 0, '0000-00-00 00:00:00'),
(80, 181, 1, 101, 'asfsdf245', '', '', 0, 0, 34, 1, 0, 2.04, 36.04, 0, 0, 0, 0, 16, '2014-07-14 05:58:40', 0, '0000-00-00 00:00:00'),
(81, 182, 1, 319, '0', '', '', 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 16, '2014-07-16 00:27:26', 0, '0000-00-00 00:00:00'),
(82, 191, 1, 293, '0', '', '', 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 16, '2014-07-16 02:10:14', 0, '0000-00-00 00:00:00'),
(84, 194, 2, 101, 'sfgsdf25345', '', '', 0, 0, 45, 1, 0, 2.7, 47.7, 0, 0, 0, 0, 16, '2014-07-17 00:33:58', 0, '0000-00-00 00:00:00'),
(85, 195, 1, 101, 'asdf2435', '', '', 0, 0, 45, 1, 0, 2.7, 47.7, 0, 0, 0, 0, 16, '2014-07-17 00:36:04', 0, '0000-00-00 00:00:00'),
(86, 208, 1, 27494, '0', '', '', 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 33, '2014-08-13 04:58:45', 0, '0000-00-00 00:00:00');

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

--
-- Table structure for table `comp_supplier_invoice_detail`
--

CREATE TABLE IF NOT EXISTS `comp_supplier_invoice_detail` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `invoiceID` int(11) NOT NULL,
  `receiveID` int(11) NOT NULL,
  `lineNo` int(11) NOT NULL,
  `itemID` int(11) NOT NULL,
  `itemname` varchar(64) NOT NULL,
  `itemdescription` text NOT NULL,
  `quantity` int(11) NOT NULL,
  `unitPrice` double NOT NULL,
  `amountExcludedTax` double NOT NULL,
  `taxID` int(11) NOT NULL,
  `taxRate` double NOT NULL,
  `taxAmount` double NOT NULL,
  `amountIncludedTax` double NOT NULL,
  `accountID` int(11) NOT NULL,
  `createdBy` int(11) NOT NULL,
  `createdTS` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `updatedBy` int(11) NOT NULL,
  `updatedTS` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=280 ;

--
-- Dumping data for table `comp_supplier_invoice_detail`
--

INSERT INTO `comp_supplier_invoice_detail` (`ID`, `invoiceID`, `receiveID`, `lineNo`, `itemID`, `itemname`, `itemdescription`, `quantity`, `unitPrice`, `amountExcludedTax`, `taxID`, `taxRate`, `taxAmount`, `amountIncludedTax`, `accountID`, `createdBy`, `createdTS`, `updatedBy`, `updatedTS`) VALUES
(146, 88, 0, 1, 2, '100300100', 'Steel chair for outdoor', 1, 1, 1, 1, 6, 0, 0, 0, 0, '2014-06-18 01:57:50', 0, '0000-00-00 00:00:00'),
(147, 89, 0, 1, 0, '', 'Teak wooden chair with natural finish', 123, 0, 0, 0, 6, 0, 0, 0, 0, '2014-06-18 09:09:02', 0, '0000-00-00 00:00:00'),
(148, 90, 0, 1, 0, '', 'Plastic Chair - White', 1, 0, 0, 28, 0, 0, 0, 0, 0, '2014-06-18 09:40:46', 0, '0000-00-00 00:00:00'),
(149, 90, 0, 2, 0, '', 'Plastic Chair - Blue', 54, 1112, 60048, 1, 0, 0, 0, 0, 0, '2014-06-18 09:41:12', 0, '0000-00-00 00:00:00'),
(150, 91, 0, 1, 0, '', 'Plastic Chair - Red', 12, 2345, 28140, 0, 0, 0, 0, 0, 0, '2014-06-18 10:11:37', 0, '0000-00-00 00:00:00'),
(151, 91, 0, 2, 1, '', 'Teak wooden chair with natural finish', 1, 0, 2345, 0, 6, 0, 0, 0, 0, '2014-07-11 08:08:42', 16, '0000-00-00 00:00:00'),
(152, 92, 0, 1, 0, '', 'Teak wooden chair with natural finish', 21, 120, 2520, 0, 6, 0, 0, 0, 0, '2014-06-18 10:27:37', 0, '0000-00-00 00:00:00'),
(153, 93, 0, 1, 1, '', 'Teak wooden chair with natural finish', 12, 122, 1464, 0, 6, 0, 0, 0, 0, '2014-06-19 01:02:31', 0, '0000-00-00 00:00:00'),
(154, 93, 0, 2, 0, '', 'Plastic Chair - Blue', 123, 0.12, 14.76, 1, 0, 0, 0, 0, 0, '2014-06-19 01:02:58', 0, '0000-00-00 00:00:00'),
(155, 93, 0, 3, 0, '', 'Teak wooden chair with natural finish', 212, 12, 2544, 0, 6, 0, 0, 0, 0, '2014-06-19 01:04:20', 0, '0000-00-00 00:00:00'),
(156, 93, 0, 4, 0, '', 'Steel chair for outdoor', 12, 3244, 38928, 1, 0, 0, 0, 0, 0, '2014-06-19 01:07:38', 0, '0000-00-00 00:00:00'),
(157, 94, 0, 1, 4, '', 'Plastic Chair - Blue', 12, 12, 144, 1, 0, 0, 0, 0, 0, '2014-06-19 01:09:11', 0, '0000-00-00 00:00:00'),
(158, 94, 0, 2, 0, '', 'Plastic Chair - Red', 12, 2345, 28140, 1, 6, 0, 0, 0, 0, '2014-06-19 01:09:53', 0, '0000-00-00 00:00:00'),
(159, 94, 0, 3, 0, '', 'Plastic Chair - Blue', 12, 12, 144, 1, 0, 0, 0, 0, 0, '2014-06-19 01:10:41', 0, '0000-00-00 00:00:00'),
(160, 94, 0, 4, 0, '', 'Plastic Chair - Blue', 2, 12, 24, 1, 0, 0, 0, 0, 0, '2014-06-19 01:12:34', 0, '0000-00-00 00:00:00'),
(161, 95, 0, 1, 7, '', 'Plastic Chair - Red', 12, 2, 144, 0, 0, 0, 0, 0, 0, '2014-06-21 00:55:47', 0, '0000-00-00 00:00:00'),
(162, 95, 0, 2, 7, '', 'Plastic Chair - Red', 2, 2, 24, 0, 0, 0, 0, 0, 0, '2014-06-21 00:55:38', 0, '0000-00-00 00:00:00'),
(163, 95, 0, 3, 1, '', 'Teak wooden chair with natural finish', 12, 0, 38, 0, 6, 0, 0, 0, 0, '2014-06-21 00:55:24', 0, '0000-00-00 00:00:00'),
(164, 96, 0, 1, 1, '', 'Teak wooden chair with natural finish', 12, 12, 144, 0, 6, 0, 0, 0, 0, '2014-06-19 01:37:31', 0, '0000-00-00 00:00:00'),
(165, 96, 0, 2, 4, '', 'Plastic Chair - Blue', 12, 12, 144, 10, 6, 0, 0, 0, 0, '2014-06-19 01:38:11', 0, '0000-00-00 00:00:00'),
(166, 96, 0, 3, 10, '', 'Bola Tampar Buaya', 12, 111, 1332, 0, 6, 0, 0, 0, 0, '2014-06-19 01:54:18', 0, '0000-00-00 00:00:00'),
(167, 97, 0, 1, 1, '', 'Teak wooden chair with natural finish', 2, 1, 2, 0, 6, 0.12, 2.12, 0, 0, '2014-07-09 02:15:11', 16, '0000-00-00 00:00:00'),
(173, 98, 0, 1, 1, '', 'Teak wooden chair with natural finish', 8, 99, 792, 0, 6, 47.52, 839.52, 0, 0, '2014-06-20 09:36:39', 0, '0000-00-00 00:00:00'),
(174, 99, 0, 1, 1, '', 'Teak wooden chair with natural finish', 0, 0, 0, 0, 6, 0, 0, 0, 0, '2014-06-23 03:21:52', 0, '0000-00-00 00:00:00'),
(175, 100, 0, 1, 1, '', 'Teak wooden chair with natural finish', 34, 0, 0, 0, 6, 0, 0, 0, 16, '2014-06-24 08:19:17', 0, '0000-00-00 00:00:00'),
(176, 100, 0, 2, 7, '', 'Plastic Chair - Red', 44, 2345, 103180, 0, 0, 0, 103180, 0, 16, '2014-06-24 08:20:47', 0, '0000-00-00 00:00:00'),
(177, 101, 0, 1, 1, '', 'Teak wooden chair with natural finish', 3, 3, 9, 0, 6, 0.54, 9.54, 0, 16, '2014-06-26 06:44:47', 0, '0000-00-00 00:00:00'),
(178, 101, 0, 2, 7, '', 'Plastic Chair - Red', 12, 2345, 28140, 0, 0, 0, 28140, 0, 16, '2014-06-26 06:45:09', 0, '0000-00-00 00:00:00'),
(179, 102, 0, 1, 11, '', 'saiz 10. warna gold', 3, 1222, 3666, 15, 10, 366.6, 4032.6, 0, 16, '2014-07-08 06:56:17', 16, '0000-00-00 00:00:00'),
(180, 103, 0, 1, 1, '', 'Teak wooden chair with natural finish', 1, 1, 1, 0, 6, 0.06, 1.06, 0, 16, '2014-07-04 00:14:51', 0, '0000-00-00 00:00:00'),
(181, 103, 0, 2, 7, '', 'Plastic Chair - Red', 1, 2345, 2345, 0, 0, 0, 2345, 0, 16, '2014-07-04 02:24:44', 0, '0000-00-00 00:00:00'),
(182, 103, 0, 3, 4, '', 'Plastic Chair - Blue', 2, 2, 4, 1, 0, 0, 4, 0, 16, '2014-07-04 02:28:41', 0, '0000-00-00 00:00:00'),
(183, 103, 0, 4, 1, '', 'Teak wooden chair with natural finish', 2, 12, 24, 0, 6, 1.44, 25.44, 0, 16, '2014-07-04 02:29:28', 0, '0000-00-00 00:00:00'),
(184, 103, 0, 5, 1, '', 'Teak wooden chair with natural finish', 1, 1, 1, 0, 6, 0.06, 1.06, 0, 16, '2014-07-04 02:31:40', 0, '0000-00-00 00:00:00'),
(185, 103, 0, 6, 4, '', 'Plastic Chair - Blue', 1, 1, 1, 1, 0, 0, 1, 0, 16, '2014-07-04 02:38:23', 0, '0000-00-00 00:00:00'),
(186, 113, 0, 1, 2, '', '', 11, 1, 11, 1, 0, 0.66, 11.66, 0, 16, '2014-07-07 05:01:40', 0, '0000-00-00 00:00:00'),
(187, 114, 0, 1, 2, '', 'Plastic Chair - Red', 11, 2345, 11, 1, 6, 0.66, 11.66, 0, 16, '2014-07-10 08:55:17', 16, '0000-00-00 00:00:00'),
(188, 123, 0, 1, 2, 'B13 Steel Chair', 'Steel chair for outdoor', 11, 1, 11, 1, 0, 0.66, 11.66, 0, 16, '2014-07-07 05:15:55', 0, '0000-00-00 00:00:00'),
(189, 124, 0, 1, 2, 'B13 Steel Chair', 'Steel chair for outdoor', 11, 1, 11, 1, 0, 0.66, 11.66, 0, 16, '2014-07-07 05:21:03', 0, '0000-00-00 00:00:00'),
(190, 125, 0, 1, 2, 'B13 Steel Chair', 'Steel chair for outdoor', 11, 1, 11, 1, 0, 0.66, 11.66, 0, 16, '2014-07-07 05:23:41', 0, '0000-00-00 00:00:00'),
(191, 126, 0, 1, 2, 'B13 Steel Chair', 'Steel chair for outdoor', 11, 1, 11, 1, 0, 0.66, 11.66, 0, 16, '2014-07-07 05:24:45', 0, '0000-00-00 00:00:00'),
(192, 127, 0, 1, 2, 'B13 Steel Chair', 'Steel chair for outdoor', 11, 1, 11, 1, 0, 0.66, 11.66, 0, 16, '2014-07-07 05:39:00', 0, '0000-00-00 00:00:00'),
(193, 131, 0, 1, 8, 'A25 Plastic Chair', 'Plastic Chair - White', 1, 1, 144, 10, 0, 8.64, 152.64, 0, 16, '2014-07-07 05:46:41', 0, '0000-00-00 00:00:00'),
(194, 131, 0, 2, 1, 'A12 Wooden Chair', 'Teak wooden chair with natural finish', 1, 1, 1, 1, 0, 0.06, 1.06, 0, 16, '2014-07-07 05:46:41', 0, '0000-00-00 00:00:00'),
(195, 131, 0, 3, 1, 'A12 Wooden Chair', 'Teak wooden chair with natural finish', 1, 10, 10, 1, 0, 0.6, 10.6, 0, 16, '2014-07-07 05:46:42', 0, '0000-00-00 00:00:00'),
(196, 131, 0, 4, 1, 'A12 Wooden Chair', 'Teak wooden chair with natural finish', 1, 0, 0, 1, 0, 0, 0, 0, 16, '2014-07-07 05:46:42', 0, '0000-00-00 00:00:00'),
(197, 134, 0, 1, 1, '', 'Teak wooden chair with natural finish', 45, 0, 0, 1, 6, 0, 0, 0, 16, '2014-07-07 05:52:17', 0, '0000-00-00 00:00:00'),
(198, 135, 0, 1, 1, 'A12 Wooden Chair', 'Teak wooden chair with natural finish', 12, 12, 144, 1, 0, 8.64, 152.64, 0, 16, '2014-07-07 05:57:08', 0, '0000-00-00 00:00:00'),
(199, 138, 0, 1, 2, 'B13 Steel Chair', 'Steel chair for outdoor', 22, 1, 0, 29, 0, 0, 0, 0, 16, '2014-07-07 06:00:01', 0, '0000-00-00 00:00:00'),
(200, 139, 0, 1, 2, 'B13 Steel Chair', 'Steel chair for outdoor', 2, 111, 0, 1, 0, 0, 0, 0, 16, '2014-07-07 06:17:13', 0, '0000-00-00 00:00:00'),
(201, 139, 0, 2, 1, 'A12 Wooden Chair', 'Teak wooden chair with natural finish', 12, 1, 12, 1, 0, 0.72, 12.72, 0, 16, '2014-07-07 06:17:13', 0, '0000-00-00 00:00:00'),
(202, 140, 0, 1, 2, 'B13 Steel Chair', 'Steel chair for outdoor', 2, 111, 0, 1, 0, 0, 0, 0, 16, '2014-07-07 06:17:37', 0, '0000-00-00 00:00:00'),
(203, 140, 0, 2, 1, 'A12 Wooden Chair', 'Teak wooden chair with natural finish', 12, 1, 12, 1, 0, 0.72, 12.72, 0, 16, '2014-07-07 06:17:37', 0, '0000-00-00 00:00:00'),
(204, 141, 0, 1, 2, 'B13 Steel Chair', 'Steel chair for outdoor', 2, 111, 0, 1, 0, 0, 0, 0, 16, '2014-07-07 06:17:43', 0, '0000-00-00 00:00:00'),
(205, 141, 0, 2, 1, 'A12 Wooden Chair', 'Teak wooden chair with natural finish', 12, 1, 12, 1, 0, 0.72, 12.72, 0, 16, '2014-07-07 06:17:43', 0, '0000-00-00 00:00:00'),
(206, 142, 0, 1, 1, 'A12 Wooden Chair', 'Teak wooden chair with natural finish', 12, 1, 12, 1, 0, 0.72, 12.72, 0, 16, '2014-07-07 06:20:29', 0, '0000-00-00 00:00:00'),
(207, 143, 0, 1, 1, 'A12 Wooden Chair', 'Teak wooden chair with natural finish', 12, 1, 12, 1, 0, 0.72, 12.72, 0, 16, '2014-07-07 06:20:40', 0, '0000-00-00 00:00:00'),
(208, 144, 0, 1, 1, 'A12 Wooden Chair', 'Teak wooden chair with natural finish', 12, 1, 12, 1, 0, 0.72, 12.72, 0, 16, '2014-07-07 06:21:37', 0, '0000-00-00 00:00:00'),
(209, 145, 0, 1, 1, 'A12 Wooden Chair', 'Teak wooden chair with natural finish', 12, 1, 12, 1, 0, 0.72, 12.72, 0, 16, '2014-07-07 06:22:38', 0, '0000-00-00 00:00:00'),
(210, 155, 0, 1, 2, '', 'asdfsf2345', 4, 34, 136, 1, 6, 8.16, 144.16, 0, 16, '2014-07-11 01:17:15', 16, '0000-00-00 00:00:00'),
(211, 104, 0, 1, 4, '', 'Plastic Chair - Blue', 33, 0, 1122, 1, 0, 67.32, 1189.32, 0, 16, '2014-07-11 01:46:14', 16, '0000-00-00 00:00:00'),
(213, 104, 0, 2, 4, '', 'Plastic Chair - Blue', 0, 0, 0, 1, 0, 0, 0, 0, 16, '2014-07-11 01:32:56', 0, '0000-00-00 00:00:00'),
(216, 158, 0, 1, 2, '', 'asdfsf2345', 4, 34, 136, 1, 6, 8.16, 144.16, 0, 16, '2014-07-11 01:17:15', 16, '0000-00-00 00:00:00'),
(217, 159, 0, 1, 1, '', 'Teak wooden chair with natural finish', 2, 1, 2, 0, 6, 0.12, 2.12, 0, 16, '2014-07-11 04:12:34', 0, '0000-00-00 00:00:00'),
(218, 160, 0, 1, 1, '', 'Teak wooden chair with natural finish', 2, 1, 2, 0, 6, 0.12, 2.12, 0, 16, '2014-07-11 04:17:30', 0, '0000-00-00 00:00:00'),
(219, 161, 0, 1, 1, '', 'Teak wooden chair with natural finish', 1, 1, 1, 1, 6, 0.06, 1.06, 0, 16, '2014-07-11 06:49:35', 0, '0000-00-00 00:00:00'),
(220, 162, 0, 1, 9, '', 'Nasi Goreng Ayam', 1, 1, 1, 26, 0, 0, 1, 0, 16, '2014-07-11 07:16:54', 0, '0000-00-00 00:00:00'),
(221, 162, 0, 2, 7, '', 'Plastic Chair - Red', 1, 1, 1, 0, 2, 0.02, 1.02, 0, 16, '2014-07-11 07:30:33', 16, '0000-00-00 00:00:00'),
(222, 170, 21, 1, 1, 'A12 Wooden Chair', 'Teak wooden chair with natural finish', 12, 10, 12, 1, 0, 0.72, 12.72, 0, 16, '2014-07-14 04:50:57', 0, '0000-00-00 00:00:00'),
(223, 171, 15, 1, 4, 'A23 Plastic Chair', 'Plastic Chair - Blue', 1, 1, 12, 0, 0, 0, 12, 0, 16, '2014-07-14 04:57:32', 0, '0000-00-00 00:00:00'),
(224, 172, 21, 1, 1, 'A12 Wooden Chair', 'Teak wooden chair with natural finish', 12, 10, 12, 1, 0, 0.72, 12.72, 0, 16, '2014-07-14 04:59:15', 0, '0000-00-00 00:00:00'),
(225, 174, 15, 1, 4, 'A23 Plastic Chair', 'Plastic Chair - Blue', 1, 1, 12, 0, 0, 0, 12, 0, 16, '2014-07-14 05:06:55', 0, '0000-00-00 00:00:00'),
(226, 174, 21, 2, 7, 'A24 Plastic Chair', 'Plastic Chair - Red', 5, 1, 11, 0, 0, 0, 11, 0, 16, '2014-07-14 05:06:55', 0, '0000-00-00 00:00:00'),
(227, 175, 21, 1, 1, 'A12 Wooden Chair', 'Teak wooden chair with natural finish', 12, 10, 12, 1, 0, 0.72, 12.72, 0, 16, '2014-07-14 05:12:39', 0, '0000-00-00 00:00:00'),
(228, 176, 18, 1, 2, 'B13 Steel Chair', 'Steel chair for outdoor', 5, 1, 11, 1, 0, 0.66, 11.66, 0, 16, '2014-07-14 05:15:49', 0, '0000-00-00 00:00:00'),
(229, 177, 11, 1, 2, 'B13 Steel Chair', 'Steel chair for outdoor', 5, 1, 11, 1, 0, 0.66, 11.66, 0, 16, '2014-07-14 05:21:47', 0, '0000-00-00 00:00:00'),
(230, 177, 11, 2, 4, 'A23 Plastic Chair', 'Plastic Chair - Blue', 1, 1, 12, 0, 0, 0, 12, 0, 16, '2014-07-14 05:21:47', 0, '0000-00-00 00:00:00'),
(231, 178, 10, 1, 2, 'B13 Steel Chair', 'Steel chair for outdoor', 5, 1, 11, 1, 0, 0.66, 11.66, 0, 16, '2014-07-14 05:27:13', 0, '0000-00-00 00:00:00'),
(232, 178, 10, 2, 7, 'A24 Plastic Chair', 'Plastic Chair - Red', 5, 1, 11, 0, 0, 0, 11, 0, 16, '2014-07-14 05:27:13', 0, '0000-00-00 00:00:00'),
(233, 179, 9, 1, 4, 'A23 Plastic Chair', 'Plastic Chair - Blue', 1, 1, 12, 0, 0, 0, 12, 0, 16, '2014-07-14 05:31:07', 0, '0000-00-00 00:00:00'),
(234, 179, 12, 2, 2, 'B13 Steel Chair', 'Steel chair for outdoor', 5, 1, 11, 1, 0, 0.66, 11.66, 0, 16, '2014-07-14 05:31:07', 0, '0000-00-00 00:00:00'),
(235, 180, 41, 1, 4, 'A23 Plastic Chair', 'Plastic Chair - Blue', 2, 12, 24, 0, 0, 0, 24, 0, 16, '2014-07-14 05:55:13', 0, '0000-00-00 00:00:00'),
(236, 181, 8, 1, 2, 'B13 Steel Chair', 'Steel chair for outdoor', 5, 1, 11, 1, 0, 0.66, 11.66, 0, 16, '2014-07-14 05:58:24', 0, '0000-00-00 00:00:00'),
(237, 181, 8, 2, 4, 'A23 Plastic Chair', 'Plastic Chair - Blue', 2, 1, 12, 0, 0, 0, 12, 0, 16, '2014-07-14 05:58:24', 0, '0000-00-00 00:00:00'),
(238, 181, 9, 3, 2, 'B13 Steel Chair', 'Steel chair for outdoor', 5, 1, 11, 1, 0, 0.66, 11.66, 0, 16, '2014-07-14 05:58:24', 0, '0000-00-00 00:00:00'),
(239, 182, 32, 1, 11, 'Meja makan bulat', 'saiz 10. warna gold', 5, 125, 625, 1, 0, 37.5, 662.5, 0, 16, '2014-07-16 00:27:26', 0, '0000-00-00 00:00:00'),
(240, 183, 62, 1, 11, 'Meja makan bulat', 'saiz 10. warna gold', 1, 2, 20, 1, 0, 1.2, 21.2, 0, 16, '2014-07-16 00:35:38', 0, '0000-00-00 00:00:00'),
(241, 184, 13, 1, 2, 'B13 Steel Chair', 'Steel chair for outdoor', 5, 1, 11, 1, 0, 0.66, 11.66, 0, 16, '2014-07-16 01:04:15', 0, '0000-00-00 00:00:00'),
(242, 184, 14, 2, 7, 'A24 Plastic Chair', 'Plastic Chair - Red', 5, 1, 11, 0, 0, 0, 11, 0, 16, '2014-07-16 01:04:15', 0, '0000-00-00 00:00:00'),
(243, 185, 62, 1, 12, 'Meja makan lonjong', 'saiz 10. warna hitam', 1, 3, 15, 1, 0, 0.9, 15.9, 0, 16, '2014-07-16 01:14:00', 0, '0000-00-00 00:00:00'),
(244, 186, 16, 1, 1, 'A12 Wooden Chair', 'Teak wooden chair with natural finish', 1, 12.5, 1, 1, 0, 0.06, 1.06, 0, 16, '2014-07-16 01:22:34', 0, '0000-00-00 00:00:00'),
(245, 186, 16, 2, 4, 'A23 Plastic Chair', 'Plastic Chair - Blue', 5, 1, 12, 0, 0, 0, 12, 0, 16, '2014-07-16 01:22:34', 0, '0000-00-00 00:00:00'),
(246, 187, 17, 1, 7, 'A24 Plastic Chair', 'Plastic Chair - Red', 5, 1, 11, 0, 0, 0, 11, 0, 16, '2014-07-16 01:23:41', 0, '0000-00-00 00:00:00'),
(247, 188, 20, 1, 4, 'A23 Plastic Chair', 'Plastic Chair - Blue', 1, 1, 12, 0, 0, 0, 12, 0, 16, '2014-07-16 01:24:56', 0, '0000-00-00 00:00:00'),
(248, 188, 22, 2, 1, 'A12 Wooden Chair', 'Teak wooden chair with natural finish', 11, 9, 11, 1, 0, 0.66, 11.66, 0, 16, '2014-07-16 01:24:56', 0, '0000-00-00 00:00:00'),
(249, 189, 23, 1, 2, 'B13 Steel Chair', 'Steel chair for outdoor', 5, 1, 11, 1, 0, 0.66, 11.66, 0, 16, '2014-07-16 01:29:14', 0, '0000-00-00 00:00:00'),
(250, 190, 24, 1, 4, 'A23 Plastic Chair', 'Plastic Chair - Blue', 1, 1, 12, 0, 0, 0, 12, 0, 16, '2014-07-16 01:43:57', 0, '0000-00-00 00:00:00'),
(251, 190, 25, 2, 2, 'B13 Steel Chair', 'Steel chair for outdoor', 5, 1, 11, 1, 0, 0.66, 11.66, 0, 16, '2014-07-16 01:43:57', 0, '0000-00-00 00:00:00'),
(252, 191, 71, 1, 11, 'Meja makan bulat', 'saiz 10. warna gold', 1, 2222, 2222, 1, 0, 133.32, 2355.32, 0, 16, '2014-07-16 02:10:14', 0, '0000-00-00 00:00:00'),
(253, 192, 25, 1, 9, 'Nasi Goreng', 'Nasi Goreng Ayam', 122, 12, 1464, 5, 0, 0, 1464, 0, 16, '2014-07-16 02:11:05', 0, '0000-00-00 00:00:00'),
(254, 192, 26, 2, 4, 'A23 Plastic Chair', 'Plastic Chair - Blue', 1, 1, 12, 0, 0, 0, 12, 0, 16, '2014-07-16 02:11:05', 0, '0000-00-00 00:00:00'),
(255, 193, 71, 1, 12, 'Meja makan lonjong', 'saiz 10. warna hitam', 4, 3333, 39996, 1, 0, 2399.76, 42395.76, 0, 16, '2014-07-16 02:11:51', 0, '0000-00-00 00:00:00'),
(256, 194, 26, 1, 1, 'A12 Wooden Chair', 'Teak wooden chair with natural finish', 1, 13, 1, 1, 0, 0.06, 1.06, 0, 16, '2014-07-17 00:33:33', 0, '0000-00-00 00:00:00'),
(257, 194, 27, 2, 7, 'A24 Plastic Chair', 'Plastic Chair - Red', 1, 1, 11, 0, 0, 0, 11, 0, 16, '2014-07-17 00:33:33', 0, '0000-00-00 00:00:00'),
(258, 194, 28, 3, 7, 'A24 Plastic Chair', 'Plastic Chair - Red', 1, 1, 11, 0, 0, 0, 11, 0, 16, '2014-07-17 00:33:33', 0, '0000-00-00 00:00:00'),
(259, 195, 28, 1, 2, 'B13 Steel Chair', 'Steel chair for outdoor', 1, 1, 11, 1, 0, 0.66, 11.66, 0, 16, '2014-07-17 00:35:51', 0, '0000-00-00 00:00:00'),
(260, 195, 29, 2, 7, 'A24 Plastic Chair', 'Plastic Chair - Red', 1, 1, 11, 0, 0, 0, 11, 0, 16, '2014-07-17 00:35:51', 0, '0000-00-00 00:00:00'),
(261, 196, 29, 1, 1, 'A12 Wooden Chair', 'Teak wooden chair with natural finish', 21, 12, 252, 1, 0, 15.12, 267.12, 0, 16, '2014-07-17 05:40:09', 0, '0000-00-00 00:00:00'),
(262, 196, 37, 2, 1, 'A12 Wooden Chair', 'Teak wooden chair with natural finish', 12, 12, 144, 1, 0, 8.64, 152.64, 0, 16, '2014-07-17 05:40:09', 0, '0000-00-00 00:00:00'),
(263, 199, 0, 1, 16, '', 'Wireless', 10, 110, 1100, 0, 6, 66, 1166, 0, 29, '2014-07-21 07:29:28', 0, '0000-00-00 00:00:00'),
(264, 200, 68, 1, 13, 'ALAT TULIS', 'ALATAN TULIS DAN MELUKIS', 10, 2, 30, 1, 0, 1.8, 31.8, 0, 1, '2014-07-24 03:55:05', 0, '0000-00-00 00:00:00'),
(265, 200, 69, 2, 13, 'ALAT TULIS', 'ALATAN TULIS DAN MELUKIS', 5, 2, 30, 1, 0, 1.8, 31.8, 0, 1, '2014-07-24 03:55:05', 0, '0000-00-00 00:00:00'),
(266, 201, 68, 1, 13, 'ALAT TULIS', 'ALATAN TULIS DAN MELUKIS', 10, 2, 30, 1, 0, 1.8, 31.8, 0, 1, '2014-07-24 03:55:07', 0, '0000-00-00 00:00:00'),
(267, 201, 69, 2, 13, 'ALAT TULIS', 'ALATAN TULIS DAN MELUKIS', 5, 2, 30, 1, 0, 1.8, 31.8, 0, 1, '2014-07-24 03:55:07', 0, '0000-00-00 00:00:00'),
(268, 202, 0, 1, 1, '', 'Teak wooden chair with natural finish', 3, 3, 9, 0, 6, 0.54, 9.54, 0, 16, '2014-06-26 06:44:47', 0, '0000-00-00 00:00:00'),
(269, 202, 0, 2, 7, '', 'Plastic Chair - Red', 12, 2345, 28140, 0, 0, 0, 28140, 0, 16, '2014-06-26 06:45:09', 0, '0000-00-00 00:00:00'),
(270, 203, 0, 1, 1, '', 'Teak wooden chair with natural finish', 3, 3, 9, 0, 6, 0.54, 9.54, 0, 16, '2014-06-26 06:44:47', 0, '0000-00-00 00:00:00'),
(271, 203, 0, 2, 7, '', 'Plastic Chair - Red', 12, 2345, 28140, 0, 0, 0, 28140, 0, 16, '2014-06-26 06:45:09', 0, '0000-00-00 00:00:00'),
(272, 204, 0, 1, 1, '', 'Teak wooden chair with natural finish', 3, 3, 9, 0, 6, 0.54, 9.54, 0, 16, '2014-06-26 06:44:47', 0, '0000-00-00 00:00:00'),
(273, 204, 0, 2, 7, '', 'Plastic Chair - Red', 12, 2345, 28140, 0, 0, 0, 28140, 0, 16, '2014-06-26 06:45:09', 0, '0000-00-00 00:00:00'),
(274, 205, 0, 1, 1, '', 'Teak wooden chair with natural finish', 3, 3, 9, 0, 6, 0.54, 9.54, 0, 16, '2014-06-26 06:44:47', 0, '0000-00-00 00:00:00'),
(275, 205, 0, 2, 7, '', 'Plastic Chair - Red', 12, 2345, 28140, 0, 0, 0, 28140, 0, 16, '2014-06-26 06:45:09', 0, '0000-00-00 00:00:00'),
(276, 206, 0, 1, 1, '', 'Teak wooden chair with natural finish', 3, 3, 9, 0, 6, 0.54, 9.54, 0, 16, '2014-06-26 06:44:47', 0, '0000-00-00 00:00:00'),
(277, 206, 0, 2, 7, '', 'Plastic Chair - Red', 12, 2345, 28140, 0, 0, 0, 28140, 0, 16, '2014-06-26 06:45:09', 0, '0000-00-00 00:00:00'),
(278, 207, 76, 1, 18, 'Laptop Dell', 'Dell High Specification', 5, 100, 500, 0, 0, 0, 500, 0, 29, '2014-08-05 01:23:47', 0, '0000-00-00 00:00:00'),
(279, 207, 77, 2, 17, 'Sony Projector', 'Projector 1 set with remote', 3, 34, 170, 0, 0, 0, 170, 0, 29, '2014-08-05 01:23:47', 0, '0000-00-00 00:00:00');

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

--
