<?php

// CLIENT INVOICES REPORT /////////////////////////////////////////////////////////////////////////
$CFG['reportsManagement']['adminReport']['columnsList']['balancedRows'] = [
	'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_confirmTime' 		    => [ 'type' => 'datetime', 	'dbCol' => "DATETIME NULL DEFAULT NULL", 						'cat' => "general"],
    'bal_addTime' 			   => [ 'type' => 'datetime', 	'dbCol' => "DATETIME NULL DEFAULT NULL", 						'cat' => "general"],

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

	'inv_id' 				=> [ 'type' => 'numeric', 	'dbCol' => "BIGINT(15) UNSIGNED NOT NULL DEFAULT '0'", 			'cat' => "invoice"],
	'inv_number' 			=> [ 'type' => 'string', 	'dbCol' => "VARCHAR(20) NOT NULL DEFAULT ''", 					'cat' => "invoice"],
	'inv_date' 				=> [ 'type' => 'date', 		'dbCol' => "DATE NULL", 										'cat' => "invoice"],
	'inv_seriesId' 			=> [ 'type' => 'numeric', 	'dbCol' => "MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0'", 		'cat' => "invoice"],
	'inv_seriesCode' 		=> [ 'type' => 'string', 	'dbCol' => "VARCHAR(100) NOT NULL DEFAULT ''", 					'cat' => "invoice"],
	'inv_statusCode'  		=> [ 'type' => 'string', 	'dbCol' => "ENUM ('n', 'p', 't', 'o') NOT NULL DEFAULT 'n'", 	'cat' => "invoice"],
	'inv_statusName' 		=> [ 'type' => 'string', 	'dbCol' => "VARCHAR(50) NOT NULL DEFAULT ''", 					'cat' => "invoice"],
	'inv_dueDate' 			=> [ 'type' => 'date', 		'dbCol' => "DATE NULL DEFAULT NULL", 							'cat' => "invoice"],
	'inv_fulfillmentDate' 	=> [ 'type' => 'date', 		'dbCol' => "DATE NULL DEFAULT NULL", 							'cat' => "invoice"],
	'inv_comments' 			=> [ 'type' => 'string', 	'dbCol' => "TEXT NOT NULL", 									'cat' => "invoice"],
	'inv_remarks' 			=> [ 'type' => 'string', 	'dbCol' => "TEXT NOT NULL", 									'cat' => "invoice"],
	'inv_processedRemarks' 	=> [ 'type' => 'string', 	'dbCol' => "TEXT NOT NULL", 									'cat' => "invoice", 'disabled' => true, 'content' => 'remarks'],
	'inv_formOfPaymentCode'	=> [ 'type' => 'string', 	'dbCol' => "VARCHAR(20) NOT NULL DEFAULT ''", 					'cat' => "invoice"],
    'inv_formOfPaymentName'	=> [ 'type' => 'string', 	'dbCol' => "VARCHAR(20) NOT NULL DEFAULT ''", 					'cat' => "invoice"],
    'inv_cumulative' 		=> [ 'type' => 'boolean', 	'dbCol' => "TINYINT(1) UNSIGNED NOT NULL DEFAULT '0'", 			'cat' => "invoice"],
	'inv_addTime' 			=> [ 'type' => 'datetime', 	'dbCol' => "DATETIME NULL", 									'cat' => "invoice"],

	'inv_partnerId' 		=> [ 'type' => 'numeric',	'dbCol' => "INT(10) UNSIGNED NOT NULL DEFAULT '0'", 			'cat' => "partner"],
	'inv_partnerName' 		=> [ 'type' => 'string', 	'dbCol' => "VARCHAR(201) NOT NULL DEFAULT ''", 					'cat' => "partner"],
	'inv_partnerTypeCode' 	=> [ 'type' => 'string', 	'dbCol' => "VARCHAR(2) NOT NULL DEFAULT ''", 					'cat' => "partner"],
	'inv_partnerTypeName' 	=> [ 'type' => 'string', 	'dbCol' => "VARCHAR(30) NOT NULL DEFAULT ''", 					'cat' => "partner"],
	'inv_corporateId' 		=> [ 'type' => 'numeric', 	'dbCol' => "INT(10) UNSIGNED NOT NULL DEFAULT '0'", 			'cat' => "partner"],
	'inv_customerId' 		=> [ 'type' => 'numeric', 	'dbCol' => "INT(10) UNSIGNED NOT NULL DEFAULT '0'", 			'cat' => "partner"],
	'inv_supplierId' 		=> [ 'type' => 'numeric', 	'dbCol' => "MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0'", 		'cat' => "partner"],
	'inv_trustId' 			=> [ 'type' => 'numeric', 	'dbCol' => "MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0'", 		'cat' => "partner"],
	'inv_trustName' 		=> [ 'type' => 'string', 	'dbCol' => "VARCHAR(100) NOT NULL DEFAULT ''", 					'cat' => "partner"],

	'inv_userId' 			=> [ 'type' => 'numeric',	'dbCol' => "SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0'",		'cat' => "invUser"],
	'inv_userName' 			=> [ 'type' => 'string', 	'dbCol' => "VARCHAR(101) NOT NULL DEFAULT ''", 				'cat' => "invUser"],
	'inv_officeId' 			=> [ 'type' => 'numeric', 	'dbCol' => "SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0'", 	'cat' => "invUser"],
	'inv_officeName' 		=> [ 'type' => 'string', 	'dbCol' => "VARCHAR(150) NOT NULL DEFAULT ''", 				'cat' => "invUser"],
	'inv_departmentId' 		=> [ 'type' => 'numeric', 	'dbCol' => "SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0'", 	'cat' => "invUser"],
	'inv_departmentName' 	=> [ 'type' => 'string', 	'dbCol' => "VARCHAR(100) NOT NULL DEFAULT ''", 				'cat' => "invUser"],
	'inv_addUserId' 		=> [ 'type' => 'numeric', 	'dbCol' => "SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0'", 	'cat' => "invUser"],
	'inv_addUserName' 		=> [ 'type' => 'string', 	'dbCol' => "VARCHAR(101) NOT NULL DEFAULT ''", 				'cat' => "invUser"],

	'serv_id' 						=> [ 'type' => 'numeric',	'dbCol' => "BIGINT(15) NOT NULL DEFAULT '0'", 				'cat' => "service"],
	'serv_passengerId' 				=> [ 'type' => 'numeric', 	'dbCol' => "INT(10) UNSIGNED NOT NULL DEFAULT '0'", 		'cat' => "service"],
	'serv_passengerName' 			=> [ 'type' => 'string', 	'dbCol' => "VARCHAR(201) NOT NULL DEFAULT ''", 				'cat' => "service"],
	'serv_ticketNumber' 			=> [ 'type' => 'string', 	'dbCol' => "VARCHAR(50) NOT NULL DEFAULT ''", 				'cat' => "service"],
    'serv_ticketDate' 				=> [ 'type' => 'date',		'dbCol' => "DATE NULL DEFAULT NULL",						'cat' => "service"],
    'serv_respUserId' 				=> [ 'type' => 'numeric', 	'dbCol' => "SMALLINT(5) NOT NULL DEFAULT '0'", 				'cat' => "service"],
	'serv_respUserName' 			=> [ 'type' => 'string', 	'dbCol' => "VARCHAR(101) NOT NULL DEFAULT ''", 				'cat' => "service"],
	'serv_respOfficeId' 			=> [ 'type' => 'numeric', 	'dbCol' => "SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0'", 	'cat' => "service"],
	'serv_respOfficeName'	 		=> [ 'type' => 'string', 	'dbCol' => "VARCHAR(150) NOT NULL DEFAULT ''", 				'cat' => "service"],
	'serv_respDeptId' 				=> [ 'type' => 'numeric', 	'dbCol' => "SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0'", 	'cat' => "service"],
	'serv_respDeptName' 			=> [ 'type' => 'string', 	'dbCol' => "VARCHAR(100) NOT NULL DEFAULT ''", 				'cat' => "service"],

	'off_id' 						=> [ 'type' => 'numeric',	'dbCol' => "BIGINT(15) NOT NULL DEFAULT '0'", 				'cat' => "offer"],
	'off_startDate' 				=> [ 'type' => 'date', 		'dbCol' => "DATE NULL DEFAULT NULL",		 				'cat' => "offer"],
	'off_endDate' 					=> [ 'type' => 'date', 		'dbCol' => "DATE NULL DEFAULT NULL",						'cat' => "offer"],
    'off_startDatetime' 			=> [ 'type' => 'datetime', 	'dbCol' => "DATETIME NULL",		 							'cat' => "offer"],
    'off_endDatetime' 				=> [ 'type' => 'datetime', 	'dbCol' => "DATETIME NULL DEFAULT NULL",					'cat' => "offer"],
    'off_externalReservationId' 	=> [ 'type' => 'string', 	'dbCol' => "VARCHAR(50) NOT NULL DEFAULT ''", 				'cat' => "offer"],
	'off_externalReservationDate' 	=> [ 'type' => 'date', 		'dbCol' => "DATE NULL DEFAULT NULL", 						'cat' => "offer"],
	'off_supplierId' 				=> [ 'type' => 'numeric', 	'dbCol' => "MEDIUMINT(8) NOT NULL DEFAULT '0'", 			'cat' => "offer"],
	'off_supplierAlias' 			=> [ 'type' => 'string', 	'dbCol' => "VARCHAR(250) NOT NULL DEFAULT ''", 				'cat' => "offer"],
	'off_destinationCountryCode' 	=> [ 'type' => 'string', 	'dbCol' => "VARCHAR(2) NOT NULL DEFAULT ''", 				'cat' => "offer"],
	'off_destinationCountryName' 	=> [ 'type' => 'string', 	'dbCol' => "VARCHAR(50) NOT NULL DEFAULT ''", 				'cat' => "offer"],
	'off_destinationCityId' 		=> [ 'type' => 'numeric', 	'dbCol' => "MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0'", 	'cat' => "offer"],
	'off_destinationCityName' 		=> [ 'type' => 'string', 	'dbCol' => "VARCHAR(100) NOT NULL DEFAULT ''", 				'cat' => "offer"],

	'order_id' 				=> [ 'type' => 'numeric', 	'dbCol' => "BIGINT(15) NOT NULL DEFAULT '0'", 			'cat' => "order"],
	'order_idConverted' 	=> [ 'type' => 'string', 	'dbCol' => "VARCHAR(8) NOT NULL DEFAULT ''", 			'cat' => "order"],
	'order_code' 			=> [ 'type' => 'string', 	'dbCol' => "VARCHAR(50) NOT NULL DEFAULT ''", 			'cat' => "order"],
	'order_number' 			=> [ 'type' => 'string', 	'dbCol' => "VARCHAR(100) NOT NULL DEFAULT ''", 			'cat' => "order"],
	'order_date' 			=> [ 'type' => 'date', 		'dbCol' => "DATE NULL DEFAULT NULL", 					'cat' => "order"],
	'order_startDate' 		=> [ 'type' => 'date', 		'dbCol' => "DATE NULL DEFAULT NULL", 							'cat' => "order"],
	'order_endDate' 		=> [ 'type' => 'date', 		'dbCol' => "DATE NULL DEFAULT NULL", 							'cat' => "order"],
	'order_userId' 			=> [ 'type' => 'numeric', 	'dbCol' => "SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0'", 'cat' => "order"],
	'order_userName' 		=> [ 'type' => 'string', 	'dbCol' => "VARCHAR(101) NOT NULL DEFAULT ''", 			'cat' => "order"],
	'order_officeId' 		=> [ 'type' => 'numeric', 	'dbCol' => "SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0'", 'cat' => "order"],
	'order_officeName' 		=> [ 'type' => 'string', 	'dbCol' => "VARCHAR(150) NOT NULL DEFAULT ''", 			'cat' => "order"],
	'order_deptId' 			=> [ 'type' => 'numeric', 	'dbCol' => "SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0'", 'cat' => "order"],
	'order_deptName' 		=> [ 'type' => 'string', 	'dbCol' => "VARCHAR(100) NOT NULL DEFAULT ''", 			'cat' => "order"],

    'row_internalId'			=> [ 'type' => 'string',	'dbCol' => "VARCHAR(16) NOT NULL DEFAULT ''",				'cat' => "rowDetails", 'disabled' => true,],
	'row_id' 		    		=> [ 'type' => 'numeric',	'dbCol' => "BIGINT(15) UNSIGNED NOT NULL DEFAULT '0'",		'cat' => "rowDetails"],
    'row_categoryCode' 			=> [ 'type' => 'string', 	'dbCol' => "VARCHAR(1) NOT NULL DEFAULT ''", 				'cat' => "rowDetails"], // c or s
    'row_categoryName' 			=> [ 'type' => 'string', 	'dbCol' => "VARCHAR(25) NOT NULL DEFAULT ''", 				'cat' => "rowDetails"],
    'row_serviceCode' 			=> [ 'type' => 'string', 	'dbCol' => "VARCHAR(2) NOT NULL DEFAULT ''", 				'cat' => "rowDetails"],
	'row_serviceName' 			=> [ 'type' => 'string', 	'dbCol' => "VARCHAR(100) NOT NULL DEFAULT ''", 				'cat' => "rowDetails"],
	'row_locationCode' 			=> [ 'type' => 'string', 	'dbCol' => "VARCHAR(25) NOT NULL DEFAULT ''", 				'cat' => "rowDetails"],
	'row_locationName' 			=> [ 'type' => 'string', 	'dbCol' => "VARCHAR(25) NOT NULL DEFAULT ''", 				'cat' => "rowDetails"],
	'row_calculationCode' 		=> [ 'type' => 'numeric', 	'dbCol' => "SMALLINT(3) NOT NULL DEFAULT '0'", 				'cat' => "rowDetails"],
	'row_calculationKey'		=> [ 'type' => 'string', 	'dbCol' => "VARCHAR(20) NOT NULL DEFAULT ''", 				'cat' => "rowDetails", 'disabled' => true],
	'row_rowTypeCode' 			=> [ 'type' => 'string', 	'dbCol' => "VARCHAR(30) NOT NULL DEFAULT ''", 				'cat' => "rowDetails"],
	'row_rowTypeName' 			=> [ 'type' => 'string', 	'dbCol' => "VARCHAR(30) NOT NULL DEFAULT ''", 				'cat' => "rowDetails"],
	'row_description' 			=> [ 'type' => 'string', 	'dbCol' => "TEXT NOT NULL", 								'cat' => "rowDetails"],
    'row_refund' 				=> [ 'type' => 'boolean', 	'dbCol' => "TINYINT(1) UNSIGNED NOT NULL DEFAULT '0'", 		'cat' => "rowDetails"],
    'row_cumulatesIdInvoiceRow' => [ 'type' => 'numeric', 	'dbCol' => "BIGINT(15) NOT NULL DEFAULT '0'", 				'cat' => "rowDetails"],

	'inv_currency' 				=> [ 'type' => 'string', 	'dbCol' => "VARCHAR(3) NOT NULL DEFAULT ''", 				'cat' => "rowPrices"],
	'inv_defCurrencyExchRate' 	=> [ 'type' => 'price',  	'dbCol' => "DECIMAL(15,8) NOT NULL DEFAULT '0'",    		'cat' => "rowPrices"],
	'inv_workCurrencyExchRate' 	=> [ 'type' => 'price',  	'dbCol' => "DECIMAL(15,8) NOT NULL DEFAULT '0'",    		'cat' => "rowPrices"],
	'row_measureUnit' 			=> [ 'type' => 'string', 	'dbCol' => "VARCHAR(50) NOT NULL DEFAULT ''", 				'cat' => "rowPrices"],
	'row_quantity'				=> [ 'type' => 'price', 	'dbCol' => "DECIMAL(8,2) UNSIGNED NOT NULL DEFAULT '0'",	'cat' => "rowPrices"],
	'row_unitValue' 			=> [ 'type' => 'price', 	'dbCol' => "DECIMAL(16,3) NOT NULL DEFAULT '0'", 			'cat' => "rowPrices"],
	'row_value' 				=> [ 'type' => 'price', 	'dbCol' => "DECIMAL(16,3) NOT NULL DEFAULT '0'", 			'cat' => "rowPrices", 'subtotals' => "inv_currency"],
	'row_valueDefCurr' 			=> [ 'type' => 'price', 	'dbCol' => "DECIMAL(16,3) NOT NULL DEFAULT '0'", 			'cat' => "rowPrices", 'subtotals' => true],
	'row_valueWorkCurr' 		=> [ 'type' => 'price', 	'dbCol' => "DECIMAL(16,3) NOT NULL DEFAULT '0'", 			'cat' => "rowPrices", 'subtotals' => true],
	'row_vat' 					=> [ 'type' => 'price', 	'dbCol' => "DECIMAL(16,3) NOT NULL DEFAULT '0'", 			'cat' => "rowPrices", 'subtotals' => "inv_currency"],
	'row_vatDefCurr' 			=> [ 'type' => 'price', 	'dbCol' => "DECIMAL(16,3) NOT NULL DEFAULT '0'", 			'cat' => "rowPrices", 'subtotals' => true],
	'row_vatWorkCurr' 			=> [ 'type' => 'price', 	'dbCol' => "DECIMAL(16,3) NOT NULL DEFAULT '0'", 			'cat' => "rowPrices", 'subtotals' => true],
	'row_total' 				=> [ 'type' => 'price', 	'dbCol' => "DECIMAL(16,3) NOT NULL DEFAULT '0'", 			'cat' => "rowPrices", 'subtotals' => "inv_currency"],
	'row_totalDefCurr' 			=> [ 'type' => 'price', 	'dbCol' => "DECIMAL(16,3) NOT NULL DEFAULT '0'", 			'cat' => "rowPrices", 'subtotals' => true],
	'row_totalWorkCurr' 		=> [ 'type' => 'price', 	'dbCol' => "DECIMAL(16,3) NOT NULL DEFAULT '0'", 			'cat' => "rowPrices", 'subtotals' => true],
	'row_vatPercent' 			=> [ 'type' => 'percent', 	'dbCol' => "DECIMAL(5,4) NOT NULL DEFAULT '0'", 			'cat' => "rowPrices"],
	'row_vatText' 				=> [ 'type' => 'string', 	'dbCol' => "VARCHAR(100) NOT NULL DEFAULT ''", 				'cat' => "rowPrices"],
	'row_profit' 				=> [ 'type' => 'price', 	'dbCol' => "DECIMAL(16,3) NOT NULL DEFAULT '0'", 			'cat' => "rowPrices", 'subtotals' => "inv_currency"],
	'row_profitDefCurr'			=> [ 'type' => 'price', 	'dbCol' => "DECIMAL(16,3) NOT NULL DEFAULT '0'", 			'cat' => "rowPrices", 'subtotals' => true],
	'row_profitWorkCurr' 		=> [ 'type' => 'price', 	'dbCol' => "DECIMAL(16,3) NOT NULL DEFAULT '0'", 			'cat' => "rowPrices", 'subtotals' => true],
	'row_profitVatPercent'		=> [ 'type' => 'percent', 	'dbCol' => "DECIMAL(3,2) NOT NULL DEFAULT '0'", 			'cat' => "rowPrices", ],
	'row_profitBase'			=> [ 'type' => 'price', 	'dbCol' => "DECIMAL(16,3) NOT NULL DEFAULT '0'", 			'cat' => "rowPrices", 'subtotals' => "inv_currency"],
	'row_profitBaseDefCurr'		=> [ 'type' => 'price', 	'dbCol' => "DECIMAL(16,3) NOT NULL DEFAULT '0'", 			'cat' => "rowPrices", 'subtotals' => true],
	'row_profitVat'				=> [ 'type' => 'price', 	'dbCol' => "DECIMAL(16,3) NOT NULL DEFAULT '0'", 			'cat' => "rowPrices", 'subtotals' => "inv_currency"],
	'row_profitVatDefCurr'		=> [ 'type' => 'price', 	'dbCol' => "DECIMAL(16,3) NOT NULL DEFAULT '0'", 			'cat' => "rowPrices", 'subtotals' => true],
	'row_estOffProfit' 			=> [ 'type' => 'price',     'dbCol' => "DECIMAL(16,3) NOT NULL DEFAULT '0'", 		    'cat' => "rowPrices", 'subtotals' => 'inv_currency'],
	'row_estOffProfitDefCurr'	=> [ 'type' => 'price',     'dbCol' => "DECIMAL(16,3) NOT NULL DEFAULT '0'", 		    'cat' => "rowPrices", 'subtotals' => true],
	'row_estOffProfitWorkCurr'	=> [ 'type' => 'price',     'dbCol' => "DECIMAL(16,3) NOT NULL DEFAULT '0'", 		    'cat' => "rowPrices", 'subtotals' => true],
];



// DATABASE FORCED COLUMNS ////////////////////////////////////////////////////////////////////////
$CFG['reportsManagement']['adminReport']['addForcedColumns']['balancedRows'] = [
	'row_internalId', 'serv_id'
];



// DATABASE COLUMNS DEPENDENCIES //////////////////////////////////////////////////////////////////
$CFG['reportsManagement']['adminReport']['columnsDependencies']['balancedRows'] = [
	'bal_dateY'				=> ['bal_id'],
	'bal_dateYM'			=> ['bal_id'],
	'bal_virtualDateY'		=> ['bal_id'],
	'bal_virtualDateYM'		=> ['bal_id'],
	'bal_confirmed'			=> ['bal_id'],

	'bal_userName'			=> ['bal_userId'],
	'bal_officeName'		=> ['bal_officeId'],
	'bal_deptId'			=> ['bal_id'],
	'bal_deptName'			=> ['bal_deptId'],
	'bal_confirmUserName'	=> ['bal_confirmUserId'],
	'bal_addUserName'		=> ['bal_addUserId'],

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

	'inv_corporateId'		=> ['inv_id'],
	'inv_customerId'		=> ['inv_id'],
	'inv_supplierId'		=> ['inv_id'],
	'inv_partnerId'			=> ['inv_supplierId', 'inv_corporateId', 'inv_customerId'],
	'inv_partnerName'		=> ['inv_partnerId'],
	'inv_partnerTypeCode'	=> ['inv_supplierId', 'inv_corporateId', 'inv_customerId'],
	'inv_partnerTypeName'	=> ['inv_partnerTypeCode'],
	'inv_trustId' 			=> ['inv_supplierId', 'inv_corporateId'],
	'inv_trustName' 		=> ['inv_trustId'],

	'inv_seriesCode'		=> ['inv_seriesId', 'inv_corporateId'],
	'inv_statusName'		=> ['inv_statusCode'],
	'inv_formOfPaymentName'	=> ['inv_formOfPaymentCode'],

	'inv_userName'			=> ['inv_userId'],
	'inv_officeName'		=> ['inv_officeId'],
	'inv_departmentId'		=> ['inv_id'],
	'inv_departmentName'	=> ['inv_departmentId'],
	'inv_addUserName'		=> ['inv_addUserId'],

	'serv_passengerId'		=> ['serv_id', 'row_categoryCode'],
	'serv_passengerName'	=> ['serv_passengerId'],
	'serv_ticketNumber'		=> ['serv_id', 'row_categoryCode'],
	'serv_ticketDate'		=> ['serv_id', 'row_categoryCode'],
	'serv_respUserId'		=> ['serv_id', 'row_categoryCode'],
	'serv_respUserName'		=> ['serv_respUserId'],
	'serv_respOfficeId'		=> ['serv_id', 'row_categoryCode'],
	'serv_respOfficeName'	=> ['serv_respOfficeId'],
	'serv_respDeptId'		=> ['serv_id', 'row_categoryCode'],
	'serv_respDeptName'		=> ['serv_respDeptId'],

	'off_id'						=> ['serv_id', 'row_categoryCode'],
	'off_startDate'					=> ['off_id'],
	'off_endDate'					=> ['off_id'],
	'off_startDatetime'				=> ['off_id'],
	'off_endDatetime'				=> ['off_id'],
	'off_externalReservationId'		=> ['off_id'],
	'off_externalReservationDate'	=> ['off_id'],
	'off_supplierId'				=> ['off_id'],
	'off_supplierAlias'				=> ['off_supplierId'],
	'off_destinationCountryCode'	=> ['off_id'],
	'off_destinationCountryName'	=> ['off_destinationCountryCode'],
	'off_destinationCityId'			=> ['off_id'],
	'off_destinationCityName'		=> ['off_destinationCityId'],

	'order_idConverted'		=> ['order_id', 'row_categoryCode'],
	'order_code'			=> ['order_id', 'row_categoryCode'],
	'order_number'			=> ['order_id', 'row_categoryCode'],
	'order_date'			=> ['order_id', 'row_categoryCode'],
	'order_startDate'		=> ['order_id', 'row_categoryCode'],
	'order_endDate'			=> ['order_id', 'row_categoryCode'],
	'order_userId'			=> ['order_id', 'row_categoryCode'],
	'order_userName'		=> ['order_userId'],
	'order_officeId'		=> ['order_id', 'row_categoryCode'],
	'order_officeName'		=> ['order_officeId'],
	'order_deptId'			=> ['order_id', 'row_categoryCode'],
	'order_deptName'		=> ['order_deptId'],

	'row_categoryName'		=> ['row_categoryCode'],
	'row_serviceName'		=> ['row_serviceCode'],
	'row_locationName'		=> ['row_locationCode'],
	'row_rowTypeName'		=> ['row_rowTypeCode'],

	'row_profit'			=> ['row_value', 'bal_profitPercent'], // this is just to make sure that the tables are present in the main SQL
	'row_profitDefCurr'		=> ['row_value', 'bal_profitPercent', 'inv_defCurrencyExchRate'], // this is just to make sure that the tables are present in the main SQL
	'row_profitWorkCurr'	=> ['row_value', 'bal_profitPercent', 'inv_defCurrencyExchRate'], // this is just to make sure that the tables are present in the main SQL

	'row_profitVatPercent'	=> ['row_calculationKey'],
	'row_profitBase'		=> ['row_profit', 'row_profitVatPercent'],
	'row_profitBaseDefCurr'	=> ['row_profit', 'row_profitVatPercent', 'inv_defCurrencyExchRate'],
	'row_profitVat'			=> ['row_profit', 'row_profitVatPercent'],
	'row_profitVatDefCurr'	=> ['row_profit', 'row_profitVatPercent', 'inv_defCurrencyExchRate'],

];



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