<?php
// BALANCES REPORT ////////////////////////////////////////////////////////////////////////////////
$CFG['reportsManagement']['adminReport']['columnsList']['balancesList'] = [

	'currentRowIndex'			=> [ 'type' => 'numeric',   'dbCol' => "INT(10) UNSIGNED NOT NULL DEFAULT '0'",             'cat' => "general"],
	'bal_id'					=> [ 'type' => 'numeric', 	'dbCol' => "BIGINT(15) UNSIGNED NOT NULL DEFAULT '0'", 			'cat' => "general"],
	'bal_number'				=> [ 'type' => 'string', 	'dbCol' => "VARCHAR(100) NOT NULL DEFAULT ''", 					'cat' => "general"],
	'bal_date'					=> [ 'type' => 'date', 		'dbCol' => "DATE NULL DEFAULT NULL", 							'cat' => "general"],
	'bal_dateY'					=> [ 'type' => 'year', 		'dbCol' => "DATE NULL DEFAULT NULL", 							'cat' => "general"],
	'bal_dateYM'				=> [ 'type' => 'yearMonth', 'dbCol' => "DATE NULL DEFAULT NULL", 							'cat' => "general"],
	'bal_code'					=> [ 'type' => 'string', 	'dbCol' => "VARCHAR(50) NOT NULL DEFAULT ''", 					'cat' => "general"],
	'bal_name'					=> [ 'type' => 'string', 	'dbCol' => "VARCHAR(250) NOT NULL DEFAULT ''", 					'cat' => "general"],
	'bal_typeCode'				=> [ 'type' => 'string',	'dbCol' => "VARCHAR(10) NOT NULL DEFAULT ''", 					'cat' => "general"],
	'bal_typeName'				=> [ 'type' => 'string', 	'dbCol' => "VARCHAR(25) NOT NULL DEFAULT ''", 					'cat' => "general"],
	'bal_statusCode'			=> [ 'type' => 'string', 	'dbCol' => "VARCHAR(10) NOT NULL DEFAULT ''", 					'cat' => "general"],
	'bal_statusName'			=> [ 'type' => 'string', 	'dbCol' => "VARCHAR(25) NOT NULL DEFAULT ''", 					'cat' => "general"],
	'bal_virtualDate'			=> [ 'type' => 'date', 		'dbCol' => "DATE NULL DEFAULT NULL", 							'cat' => "general"],
	'bal_virtualDateY' 			=> [ 'type' => 'year', 		'dbCol' => "DATE NULL DEFAULT NULL", 							'cat' => "general"],
	'bal_virtualDateYM' 		=> [ 'type' => 'yearMonth', 'dbCol' => "DATE NULL DEFAULT NULL", 							'cat' => "general"],
	'bal_generationType'		=> [ 'type' => 'string', 	'dbCol' => "ENUM ('manual', 'auto') NOT NULL DEFAULT 'manual'", 'cat' => "general"],
	'bal_confirmed'				=> [ 'type' => 'boolean', 	'dbCol' => "TINYINT(1) UNSIGNED NOT NULL DEFAULT '0'", 			'cat' => "general"],
	'bal_comments'				=> [ 'type' => 'string', 	'dbCol' => "TEXT NOT NULL", 									'cat' => "general"],
	'bal_remarks' 				=> [ 'type' => 'string', 	'dbCol' => "TEXT NOT NULL", 									'cat' => "general"],
	'bal_processedRemarks'		=> [ 'type' => 'string', 	'dbCol' => "TEXT NOT NULL", 									'cat' => "general", 'disabled' => true, 'content' => 'remarks'],
	'bal_totalIncomeDefCurr'	=> [ 'type' => 'price',    	'dbCol' => "DECIMAL(16,3) NOT NULL DEFAULT '0'", 				'cat' => "general"],
	'bal_totalExpensesDefCurr'	=> [ 'type' => 'price',    	'dbCol' => "DECIMAL(16,3) NOT NULL DEFAULT '0'", 				'cat' => "general"],
	'bal_totalProfitDefCurr'	=> [ 'type' => 'price',    	'dbCol' => "DECIMAL(16,3) NOT NULL DEFAULT '0'", 				'cat' => "general"],
	'bal_profitPercent'			=> [ 'type' => 'percent',    'dbCol' => "DECIMAL(8,6) NOT NULL DEFAULT '0'", 				'cat' => "general"],

	'bal_userId' 			=> [ 'type' => 'numeric', 	'dbCol' => "SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0'", 		'cat' => "users"],
	'bal_userName' 			=> [ 'type' => 'string', 	'dbCol' => "VARCHAR(101) NOT NULL DEFAULT ''", 					'cat' => "users"],
	'bal_officeId' 			=> [ 'type' => 'numeric', 	'dbCol' => "SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0'", 		'cat' => "users"],
	'bal_officeName' 		=> [ 'type' => 'string', 	'dbCol' => "VARCHAR(100) NOT NULL DEFAULT ''", 					'cat' => "users"],
	'bal_deptId' 			=> [ 'type' => 'numeric', 	'dbCol' => "SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0'", 		'cat' => "users"],
	'bal_deptName' 			=> [ 'type' => 'string', 	'dbCol' => "VARCHAR(100) NOT NULL DEFAULT ''", 					'cat' => "users"],
	'bal_confirmUserId' 	=> [ 'type' => 'numeric', 	'dbCol' => "SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0'", 		'cat' => "users"],
	'bal_confirmUserName'	=> [ 'type' => 'string', 	'dbCol' => "VARCHAR(101) NOT NULL DEFAULT ''", 					'cat' => "users"],
	'bal_addUserId' 		=> [ 'type' => 'numeric', 	'dbCol' => "SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0'", 		'cat' => "users"],
	'bal_addUserName'		=> [ 'type' => 'string', 	'dbCol' => "VARCHAR(101) NOT NULL DEFAULT ''", 					'cat' => "users"],

	'bal_confirmTime' 		=> [ 'type' => 'datetime', 	'dbCol' => "DATETIME NULL DEFAULT NULL", 						'cat' => "operationTimes"],
	'bal_addTime' 			=> [ 'type' => 'datetime', 	'dbCol' => "DATETIME NULL DEFAULT NULL", 						'cat' => "operationTimes"],

];

// DATABASE FORCED COLUMNS ////////////////////////////////////////////////////////////////////////
$CFG['reportsManagement']['adminReport']['addForcedColumns']['balancesList'] = [
	'bal_id'
];

// DATABASE COLUMNS DEPENDENCIES //////////////////////////////////////////////////////////////////
$CFG['reportsManagement']['adminReport']['columnsDependencies']['balancesList'] = [
	'bal_userName'			=> ['bal_userId'],
	'bal_officeName'		=> ['bal_officeId'],
	'bal_deptName'			=> ['bal_deptId'],
	'bal_confirmUserName'	=> ['bal_confirmUserId'],
	'bal_addUserName'		=> ['bal_addUserId'],

	'bal_typeName'			=> ['bal_typeCode'],
	'bal_statusName'		=> ['bal_statusCode'],
];

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