CREATE TABLE `ob_weighment` (
	`id` int(11) UNSIGNED NOT NULL,
	`cId` int(11) UNSIGNED NOT NULL,
	`transId` int(11) UNSIGNED NOT NULL,
	`transNo` varchar(50) NOT NULL,
	`transType` varchar(2) NOT NULL,
	`truckNo` varchar(16) NOT NULL,
	`loadDate` timestamp NULL DEFAULT NULL,
	`emptyDate` timestamp NULL DEFAULT NULL,
	`itemId` int(11) UNSIGNED NOT NULL,
	`itemName` varchar(255) NOT NULL,
	`conId` int(11) UNSIGNED NOT NULL,
	`conName` varchar(100) NOT NULL,
	`loadWeight` int(11) UNSIGNED NOT NULL DEFAULT '0',
	`emptyWeight` int(11) UNSIGNED NOT NULL DEFAULT '0',
	`isSale` tinyint(1) NOT NULL DEFAULT '1',
	`updatedBy` varchar(60) NOT NULL,
	`updatedOn` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `ob_weighment` ADD PRIMARY KEY (`id`);
ALTER TABLE `ob_weighment` MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE `ob_weighment` ADD `mode` char(1) NOT NULL DEFAULT 'A' AFTER `isSale`;

SET @cId:=23;
INSERT INTO `ob_compfields` (`cId`, `tType`, `accId`, `accCode`, `fName`, `fCode`, `fType`, `fOptions`, `fValue`, `isActive`, `isRequired`, `isPrint`, `isGrid`, `isTotCol`, `orderId`, `classCode`) VALUES
(@cId,'PI',NULL,NULL,'SNo','','text','','',1,0,1,0,0,0,''),
(@cId,'PI',NULL,NULL,'Vehicle No','','text','','',1,0,1,0,0,0,''),
(@cId,'PI',NULL,NULL,'Empty Weight','','text','','',1,0,1,0,0,0,''),
(@cId,'PI',NULL,NULL,'Load Weight','','text','','',1,0,1,0,0,0,''),
(@cId,'SI',NULL,NULL,'SNo','','text','','',1,0,1,0,0,0,'All'),
(@cId,'SI',NULL,NULL,'Vehicle No','','text','','',1,0,1,0,0,0,'All'),
(@cId,'SI',NULL,NULL,'Empty Weight','','text','','',1,0,1,0,0,0,'All'),
(@cId,'SI',NULL,NULL,'Load Weight','','text','','',1,0,1,0,0,0,'All'),
(@cId,'SR',NULL,NULL,'SNo','','text','','',1,0,1,0,0,0,'All'),
(@cId,'SR',NULL,NULL,'Vehicle No','','text','','',1,0,1,0,0,0,'All'),
(@cId,'SR',NULL,NULL,'Empty Weight','','text','','',1,0,1,0,0,0,'All'),
(@cId,'SR',NULL,NULL,'Load Weight','','text','','',1,0,1,0,0,0,'All');

