Code Duplication    Length = 8-8 lines in 3 locations

web_interface/astpp/application/modules/reports/controllers/reports.php 2 locations

@@ 826-833 (lines=8) @@
823
		}
824
	$debit_sum = 0;
825
	$credit_sum = 0;
826
	foreach($res as $value){
827
 		 $cust_type = $this->common->get_field_name('posttoexternal', 'accounts', $value['accountid']);	    
828
 		 $cust_type = $this->common->get_field_name('posttoexternal', 'accounts', $value['accountid']);	    
829
		$debit_sum += $value['debit'];
830
		$credit_sum += $value['credit'];
831
		$before_balance += $value['before_balance'];
832
		$after_balance += $value['after_balance'];
833
	}
834
		if ($this->session->userdata('logintype') == 1) {
835
			$json_data['rows'][$count_all]['cell']=array('<b>Total</b>','-','-','-','-','<b>'.$this->common->convert_to_currency('','',$debit_sum).'</b>','<b>'.$this->common->convert_to_currency('','',$credit_sum).'</b>','-','-');
836
	}else{
@@ 948-955 (lines=8) @@
945
		}
946
	$debit_sum = 0;
947
	$credit_sum = 0;
948
	foreach($res as $value){
949
 		 $cust_type = $this->common->get_field_name('posttoexternal', 'accounts', $value['accountid']);	    
950
 		 $cust_type = $this->common->get_field_name('posttoexternal', 'accounts', $value['accountid']);	    
951
		$debit_sum += $value['debit'];
952
		$credit_sum += $value['credit'];
953
		$before_balance += $value['before_balance'];
954
		$after_balance += $value['after_balance'];
955
	}
956
		if ($this->session->userdata('logintype') == 1) {
957
			$json_data['rows'][$count_all]['cell']=array('<b>Total</b>','-','-','-','<b>'.$this->common->convert_to_currency('','',$debit_sum).'</b>','<b>'.$this->common->convert_to_currency('','',$credit_sum).'</b>','-','-');
958
	}else{

web_interface/astpp/application/modules/user/controllers/user.php 1 location

@@ 980-987 (lines=8) @@
977
		}
978
	$debit_sum = 0;
979
	$credit_sum = 0;
980
	foreach($res as $value){
981
 		 $cust_type = $this->common->get_field_name('posttoexternal', 'accounts', $value['accountid']);	    
982
 		 $cust_type = $this->common->get_field_name('posttoexternal', 'accounts', $value['accountid']);	    
983
		$debit_sum += $value['debit'];
984
		$credit_sum += $value['credit'];
985
		$before_balance += $value['before_balance'];
986
		$after_balance += $value['after_balance'];
987
	}
988
			$json_data['rows'][$count_all]['cell']=array('<b>Total</b>','-','-','-','<b>'.$this->common->convert_to_currency('','',$debit_sum).'</b>','<b>'.$this->common->convert_to_currency('','',$credit_sum).'</b>','-','-');
989
	  echo json_encode($json_data);
990