diff -r mantis-1.1.1.orig/billing_inc.php mantis-1.1.1/billing_inc.php
81a82,87
> 	if (ALL_PROJECTS != $f_project_id) {
> 		$t_bugnote_stats_include_subprojects = gpc_get_bool('include_subprojects', 0);
> 	}
> 	else {  // always include sub-projects in this case
> 		$t_bugnote_stats_include_subprojects = 1;
> 	}
123a130,141
> <tr class="row-2">
> 	<td>
> 		<?php echo lang_get( 'time_tracking_include_subprojects' ) ?>:
> 		<input type="checkbox" name="include_subprojects"
> 		<?php if ($t_bugnote_stats_include_subprojects) {
> 			echo 'checked="checked" ';
> 		}
> 		if (ALL_PROJECTS == $f_project_id) {  // always include sub-projects in this case
> 			echo 'disabled="disabled" ';
> 		}
> 		?>/>
> 	</td>
136,137c154
< 	$t_bugnote_stats = bugnote_stats_get_project_array( $f_project_id, $t_from, $t_to, $f_bugnote_cost );
< 
---
> 	$t_bugnote_stats = bugnote_stats_get_project_array( $f_project_id, $t_from, $t_to, $f_bugnote_cost, $t_bugnote_stats_include_subprojects );
diff -r mantis-1.1.1.orig/core/bugnote_api.php mantis-1.1.1/core/bugnote_api.php
512c512,513
< 	function bugnote_stats_get_project_array( $p_project_id, $p_from, $p_to, $p_cost ) {
---
> //	function bugnote_stats_get_project_array( $p_project_id, $p_from, $p_to, $p_cost ) {
> 	function bugnote_stats_get_project_array( $p_project_id, $p_from, $p_to, $p_cost, $p_include_subprojects ) {
559a561,576
> 		if ($p_include_subprojects && ALL_PROJECTS != $c_project_id ) {
> 			$t_project_hierarchy_table = config_get( 'mantis_project_hierarchy_table' );
> 			$query = "SELECT child_id FROM $t_project_hierarchy_table
> 					WHERE parent_id = $c_project_id";
> 			$result = db_query( $query );
> 			while ( $row = db_fetch_array( $result ) ) {
> 				$child_id = $row['child_id'];
> 				// Recursive call :
> 				$t_results_child = bugnote_stats_get_project_array( $child_id,
> 																	$p_from, $p_to, $p_cost,
> 																	true );
> 				// Merge results : works since results have integer indeces
> 				$t_results = array_merge($t_results, $t_results_child);
> 			}
> 		}
> 
diff -r mantis-1.1.1.orig/lang/strings_english.txt mantis-1.1.1/lang/strings_english.txt
1414a1415
> $s_time_tracking_include_subprojects = 'Include sub-projects in report';
