Service Unavailable - Sales Reports V4.3.4

I have upgraded to v4.3.4 and I am getting an error of Service Unavailable - Sorry Service is Temporarily Unavailable but only when I access Sales Reports. Everything else seems to work OK.

I don't use Sales Reports often so maybe it was a problem before I upgraded.

Does anybody have any ideas about how I might fix this problem ?

Thanks

Paul

I get this error when I turn on error reporting

Tygh\Exceptions\AException

Message

Column 'order_id' in where clause is ambiguous (1052)

SELECT SUM(amount) as total , DATE_FORMAT(FROM_UNIXTIME(timestamp), '%Y-%m') as `interval`, timestamp FROM cscart_order_details LEFT JOIN cscart_orders ON cscart_orders.order_id = cscart_order_details.order_id WHERE cscart_orders.order_id IN ('1686', '1694', '1756', '1766', '1884', '1917', '1987', '2024', '2171', '2172', '2233', '2261', '2270', '2300', '2369', '2371', '2377', '2410', '2485', '2509', '2535', '2616', '2617', '2620', '2632', '2816', '2830', '2845', '2854', '2867', '2986', '2989', '2999', '3072') AND timestamp BETWEEN 1356962400 AND 1448892000 AND status != 'T' AND is_parent_order != 'Y' AND order_id IN (1686, 1694, 1756, 1766, 1884, 1917, 1987, 2024, 2171, 2172, 2233, 2261, 2270, 2300, 2369, 2371, 2377, 2410, 2485, 2509, 2535, 2616, 2617, 2620, 2632, 2816, 2830, 2845, 2854, 2867, 2986, 2989, 2999, 3072) AND product_id IN (119) GROUP BY `interval`

Error at

app/Tygh/Database.php, line: 714

Backtrace

			File:
		
			app/Tygh/Database.php
	
			Line:
		
			359
	
			Function:
		
			error
	
			File:
		
			app/Tygh/Database.php
	
			Line:
		
			166
	
			Function:
		
			query
	
			File:
		
			app/functions/fn.database.php
	
			Line:
		
			42
	
			Function:
		
			getHash
	
			File:
		
			app/functions/fn.sales_reports.php
	
			Line:
		
			548
	
			Function:
		
			db_get_hash_array
	
			File:
		
			app/controllers/backend/sales_reports.php
	
			Line:
		
			216
	
			Function:
		
			fn_get_report_statistics
	
			File:
		
			app/functions/fn.control.php
	
			Line:
		
			680
	
			Function:
		
			include
	
			File:
		
			app/functions/fn.control.php
	
			Line:
		
			451
	
			Function:
		
			fn_run_controller
	
			File:
		
			xxxxxxx.php
	
			Line:
		
			27
	
			Function:
		
			fn_dispatch
	

​

Submit to bugtracker. order_id is unqualified in the 2nd use in the WHERE clause.

We faced such issue several times also. Please post it to the bug tracker

i think that was a bug back from version 4..0. Can't remember what the fix was

http://forum.cs-cart.com/tracker/issue-4933-error-in-reports/

You may need to contack them

This is a confirmed bug and it will be fixed in 4.3.5.

You can fix this by your own. Edit the app/functions/fn.sales_reports.php file and replace this line:

$order_ids = fn_proceed_table_conditions($table_condition);

with this one:

$order_ids = fn_proceed_table_conditions($table_condition, '?:orders');

Thankyou

This fixed the problem.

Thanks very much for the quick fix, confirm this worked for us too.

TradeWeb