DROP TABLE IF EXISTS `ob_weighment`;
CREATE TABLE `ob_weighment` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `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,
  `mode` char(1) NOT NULL DEFAULT 'A',
  `updatedBy` varchar(60) NOT NULL,
  `updatedOn` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- SET @cId=1212;
SELECT id INTO @cId FROM ob_companies LIMIT 1;
INSERT INTO `ob_compfields` (`cId`, `tType`, `accId`, `accCode`, `fName`, `fCode`, `fType`, `fOptions`, `fValue`, `isActive`, `isRequired`, `isPrint`, `isGrid`, `isTotCol`, `orderId`, `classCode`) VALUES
(@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,	'SI',	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'),
(@cId,	'SR',	NULL,	NULL,	'SNo',	'',	'text',	'',	'',	1,	0,	1,	0,	0,	0,	'All'),

(@cId,	'PI',	NULL,	NULL,	'Vehicle No',	'',	'text',	'',	'',	1,	0,	1,	0,	0,	0,	'All'),
(@cId,	'PI',	NULL,	NULL,	'Empty Weight',	'',	'text',	'',	'',	1,	0,	1,	0,	0,	0,	'All'),
(@cId,	'PI',	NULL,	NULL,	'Load Weight',	'',	'text',	'',	'',	1,	0,	1,	0,	0,	0,	'All'),
(@cId,	'PI',	NULL,	NULL,	'SNo',	'',	'text',	'',	'',	1,	0,	1,	0,	0,	0,	'All'),
(@cId,	'PI',	NULL,	NULL,	'Transporter',	'',	'select',	'',	'',	1,	0,	1,	0,	0,	0,	'All');

