<?php
// SUPPLIER CONTRACTS REPORT
$CFG['reportsManagement']['adminReport']['columnsList']['supplierContracts'] = [
	'cont_id'				=> ['type'=>'numeric', 		'dbCol'=>"INT(10) UNSIGNED NOT NULL", 				'cat'=>"general"],
	'cont_number'			=> ['type'=>'string', 		'dbCol'=>"VARCHAR(50) NOT NULL DEFAULT ''", 		'cat'=>"general"],
	'cont_date'				=> ['type'=>'date', 		'dbCol'=>"DATE DEFAULT NULL", 						'cat'=>"general"],
	'cont_typeCode'			=> ['type'=>'string', 		'dbCol'=>"VARCHAR(20) NOT NULL DEFAULT ''",			'cat'=>"general"],
	'cont_typeName'			=> ['type'=>'string', 		'dbCol'=>"VARCHAR(30) NOT NULL DEFAULT ''",			'cat'=>"general"],
	'cont_expireDate'		=> ['type'=>'date', 		'dbCol'=>"DATE DEFAULT NULL", 						'cat'=>"general"],
	'cont_active'			=> ['type'=>'boolean', 		'dbCol'=>"TINYINT(1) NOT NULL DEFAULT '0'", 		'cat'=>"general"],
	'cont_serviceCode'		=> ['type'=>'string', 		'dbCol'=>"VARCHAR(2) NOT NULL DEFAULT ''", 			'cat'=>"general"],
	'cont_serviceName'		=> ['type'=>'string', 		'dbCol'=>"VARCHAR(100) NOT NULL DEFAULT ''", 		'cat'=>"general"],
	'cont_content'			=> ['type'=>'string', 		'dbCol'=>"MEDIUMTEXT NOT NULL", 					'cat'=>"general"],
	'cont_fileName'			=> ['type'=>'string',		'dbCol'=>"VARCHAR(250) NOT NULL DEFAULT ''",		'cat'=>"general"],

	'user_respIdUser'			=> ['type'=>'numeric',		'dbCol'=>"SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0'", 	'cat'=>"responsible"],
	'user_respUserName'			=> ['type'=>'string', 		'dbCol'=>"VARCHAR(101) NOT NULL DEFAULT ''", 			'cat'=>"responsible"],
	'user_respIdOffice'			=> ['type'=>'numeric', 		'dbCol'=>"SMALLINT(5) NOT NULL DEFAULT '0'", 			'cat'=>"responsible"],
	'user_respOfficeName'		=> ['type'=>'string',		'dbCol'=>"VARCHAR(150) NOT NULL DEFAULT ''", 			'cat'=>"responsible"],
	'user_respIdDepartment'		=> ['type'=>'numeric', 		'dbCol'=>"SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0'", 	'cat'=>"responsible"],
	'user_respDepartmentName' 	=> ['type'=>'string', 		'dbCol'=>"VARCHAR(100) NOT NULL DEFAULT ''", 			'cat'=>"responsible"],

	'supp_id'				=> ['type'=>'numeric', 		'dbCol'=>"INT(10) UNSIGNED NOT NULL DEFAULT '0'", 			'cat'=>"supplier"],
	'supp_alias'			=> ['type'=>'string', 		'dbCol'=>"VARCHAR(100) NOT NULL DEFAULT ''", 				'cat'=>"supplier"],
	'supp_companyName'		=> ['type'=>'string', 		'dbCol'=>"VARCHAR(170) NOT NULL DEFAULT ''", 				'cat'=>"supplier"],
	'supp_idTrust'			=> ['type'=>'numeric', 		'dbCol'=>"INT(10) UNSIGNED NOT NULL DEFAULT '0'", 			'cat'=>"supplier"],
	'supp_trustName'		=> ['type'=>'string', 		'dbCol'=>"VARCHAR(100) NOT NULL DEFAULT ''", 				'cat'=>"supplier"],
	'supp_duplicated'		=> ['type'=>'boolean',		'dbCol'=>"TINYINT(1) UNSIGNED NOT NULL DEFAULT '0'",		'cat'=>"supplier"],
	'supp_idOriginal'		=> ['type'=>'numeric',		'dbCol'=>"INT(10) UNSIGNED NOT NULL DEFAULT '0'",			'cat'=>"supplier"],

	'user_idAddUser'				=> ['type'=>'numeric', 		'dbCol'=>"SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0'", 	'cat'=>"admin"],
	'user_addUserName'				=> ['type'=>'string', 		'dbCol'=>"VARCHAR(101) NOT NULL DEFAULT ''", 			'cat'=>"admin"],
	'user_idUpdateUser'				=> ['type'=>'numeric', 		'dbCol'=>"SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0'", 	'cat'=>"admin"],
	'user_updateUserName'			=> ['type'=>'string', 		'dbCol'=>"VARCHAR(101) NOT NULL DEFAULT ''", 			'cat'=>"admin"],
	'cont_addTime'					=> ['type'=>'datetime', 	'dbCol'=>"DATETIME NULL", 								'cat'=>"admin"],
	'cont_lastUpdateTime'			=> ['type'=>'datetime', 	'dbCol'=>"DATETIME NULL DEFAULT NULL", 					'cat'=>"admin"],
	'cont_updatesCount'				=> ['type'=>'numeric', 		'dbCol'=>"SMALLINT(5) NOT NULL DEFAULT '0'", 			'cat'=>"admin"],

];


// DATABASE FORCED COLUMNS
$CFG['reportsManagement']['adminReport']['addForcedColumns']['supplierContracts'] = [
	'cont_id'
];


// DATABASE COLUMNS DEPENDENCIES
$CFG['reportsManagement']['adminReport']['columnsDependencies']['supplierContracts'] = [
	'cont_typeName'				=> ['cont_typeCode'],
	'cont_serviceName' 			=> ['cont_serviceCode'],

	'user_addUserName' 			=> ['user_idAddUser'],
	'user_updateUserName'		=> ['user_idUpdateUser'],

	'user_respUserName' 		=> ['user_respIdUser'],
	'user_respOfficeName' 		=> ['user_respIdOffice'],
	'user_respDepartmentName' 	=> ['user_respIdDepartment'],

	'supp_alias'				=> ['supp_id'],
	'supp_companyName'			=> ['supp_id'],
	'supp_idTrust'				=> ['supp_id'],
	'supp_trustName'			=> ['supp_idTrust'],

];


// TABLE PRIMARY KEY (can be more columns, separated by comma)
$CFG['reportsManagement']['adminReport']['tablePrimaryKey']['supplierContracts'] = '`cont_id`';
