SELECT SQL_CALC_FOUND_ROWS
								 a.*
			, 
			s.name AS supplier,
			w.name AS warehouse,
			stl.name AS state,
			st.delivery_note,
			st.editable,
			st.enclosed,
			st.receipt_state,
			st.pending_receipt,
			st.color AS color,
			a.id_supply_order as id_export
			FROM `ps_supply_order` a 
			
			
			LEFT JOIN `ps_supply_order_state_lang` stl ON
			(
				a.id_supply_order_state = stl.id_supply_order_state
				AND stl.id_lang = 1
			)
			LEFT JOIN `ps_supply_order_state` st ON a.id_supply_order_state = st.id_supply_order_state
			LEFT JOIN `ps_supplier` s ON a.id_supplier = s.id_supplier
			LEFT JOIN `ps_warehouse` w ON (w.id_warehouse = a.id_warehouse) 
			 WHERE 1   AND a.is_template = 0 
			
			 ORDER BY a.`id_supply_order` ASC